Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-7273 : new openmq version to avoid duplicate consumers #6350

Conversation

luiseufrasio
Copy link
Contributor

This PR depends on: payara/patched-src-openmq#23

Description

Fix Incorrect 'imqcmd' calculations for the number of consumers after cluster restart

The imqcmd utility shipped with Open MQ software in Payara Server has a list destinations command that shows basic statistics of the number of producers, consumers and messages for each destination configured. After a cluster restart, the numbers shown by the command’s output are incorrect on a variable frequency, but close to the actual number to be shown. For example, where the number of consumers is 8 for a specific cluster instance, the number displayed might be 6, 7, 9, 10

Important Info

Dependant PRs

payara/patched-src-openmq#23

Testing

New tests

No

Testing Performed

  1. .\asadmin create-domain --portbase 9000 domain-9000

  2. .\asadmin start-domain domain-9000

  3. .\asadmin copy-config --port 9048 default-config jms-config

  4. .\asadmin create-cluster --port 9048 --config=jms-config test-cluster

  5. .\asadmin configure-jms-cluster --port 9048 --clustertype=conventional --messageStoreType=file --configStoreType=masterbroker test-cluster

  6. Nodes:
    .\asadmin create-node-config --port 9048 local-node-1
    .\asadmin create-node-config --port 9048 local-node-2
    .\asadmin create-node-config --port 9048 local-node-3
    .\asadmin create-node-config --port 9048 local-node-4

  7. Instances:
    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-1 ci1
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-1 ci1

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-2 ci2
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-2 ci2

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-3 ci3
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-3 ci3

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-4 ci4
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-4 ci4

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-1 ci5
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-1 ci5

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-2 ci6
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-2 ci6

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-3 ci7
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-3 ci7

    .\asadmin create-instance --port 9048 --cluster=test-cluster --node=local-node-4 ci8
    payara6\glassfish\lib> .\nadmin --host HOST_NAME --port 9048 create-local-instance --node local-node-4 ci8

  8. Config LOCAL
    .\asadmin set configs.config.jms-config.availability-service.jms-availability.availability-enabled=false --port=9048
    .\asadmin set configs.config.jms-config.jms-service.type=LOCAL --port=9048

  9. Create 2 new JMS resources:
    .\asadmin create-connector-connection-pool --connectionDefinitionName=jakarta.jms.QueueConnectionFactory --resourceAdapterName=jmsra jms/SampleConnectionFactory-Connection-Pool --port=9048
    .\asadmin create-connector-resource --objecttype=user --enabled=true --poolName=jms/SampleConnectionFactory-Connection-Pool jms/SampleConnectionFactory --port=9048
    .\asadmin create-jms-resource --resType=jakarta.jms.Queue --property=Name=sampleQueue --enabled=true jms/SampleQueue --port=9048

    .\asadmin create-resource-ref --enabled=true --target=test-cluster jms/SampleConnectionFactory --port=9048
    .\asadmin create-resource-ref --enabled=true --target=test-cluster jms/SampleQueue --port=9048

  10. .\asadmin deploy --port=9048 --target=test-cluster --name=JMS-Test C:\code\reproducers\reproducer-7273\JMSGeneralTest\target\JMSGeneralTest-1.0-SNAPSHOT.war

  11. start the instances:
    .\asadmin start-instance --port=9048 ci1
    .\asadmin start-instance --port=9048 ci2
    .\asadmin start-instance --port=9048 ci3
    ...
    .\asadmin start-instance --port=9048 ciN

  12. Run the imqcmd list dst command (default user/password: admin/admin)
    \Payara\appserver\distributions\payara\target\stage\payara6\mq\bin> .\imqcmd -b HOST_NAME:27676 list dst
    \Payara\appserver\distributions\payara\target\stage\payara6\mq\bin> .\imqcmd -b HOST_NAME:27677 list dst
    ...
    \Payara\appserver\distributions\payara\target\stage\payara6\mq\bin> .\imqcmd -b HOST_NAME:27683 list dst

For each PORT should return the correct number of Consumers created

Test suites executed

  • Quicklook
  • Payara Samples
  • Java EE7 Samples
  • Java EE8 Samples
  • Payara Microprofile TCKs Runner
  • Jakarta TCKs
  • Mojarra
  • Cargo Tracker

Testing Environment

Zulu JDK 1.8_212 on Windows 11 with Maven 3.6.0

Notes for Reviewers

In my local tests with only 3 instances: ci1, ci2 and ci3 I could reproduce th problem
Running the command on ci2: \Payara\appserver\distributions\payara\target\stage\payara6\mq\bin> .\imqcmd -b HOST_NAME:27677 list dst
It returned 4 instead of 3

@breakponchito
Copy link
Contributor

Jenkins test please

Copy link
Contributor

@breakponchito breakponchito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants