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

No queues are visible when session is opened on an embedded Apache ActiveMQ #17

Closed
marcoaltieri opened this issue Jul 15, 2018 · 6 comments
Labels
kind/bug Something isn't working qm/activemq
Milestone

Comments

@marcoaltieri
Copy link

marcoaltieri commented Jul 15, 2018

Specifications

  • JMSToolBox version: v4.10.0
  • OS (Name, version, 32/64bits): Ubuntu Xenial 64bits
  • Q provider (kind, version) : Embedded ActiveMQ 5.14.5 (started using Spring Boot 1.5.13.RELEASE)

Expected Behavior

In the running ActiveMQ broker there are a couple of queues.
I can see them using jconsole and the connection string:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
Using jconsole, I can send messages to the existing queues as well.

I am expecting to see the same queues in JMSToolbox.

Actual Behavior

After opening a connection, I do not see any queue.
There is an exception in the .log file. See attachments.

Steps to Reproduce the Problem

  1. Start JMSToolbox
  2. Define a new session with:
    queue manager: Apache Active MQ
    hostname: localhost
    port: 1099
  3. Open the session.

I can see the folder "Queues" and "Topics" but no children.
jmstoolbox.log
log.log

@titou10titou10
Copy link
Contributor

If you can see the Queues and Topics with jconsole, could you get the fully qualifiied QName of one of them?
It should contain either "type=Broker,destinationType=Queue,destinationName=" or "Type=Queue,Destination=".
This is what JTB is looking for in order to discover the queues and topics
Thx

@titou10titou10
Copy link
Contributor

I tested it here with this code that starts and embedded ActiveMQ v5.15.4 broker, create one queue and one topic and it works with JMSToolBox...

BrokerService broker = new BrokerService();
broker.addConnector("tcp://localhost:61616");
broker.setUseJmx(true);
ActiveMQDestination q = ActiveMQDestination.createDestination("testQueue", ActiveMQDestination.QUEUE_TYPE);
ActiveMQDestination t = ActiveMQDestination.createDestination("testTopic", ActiveMQDestination.TOPIC_TYPE);
broker.setDestinations(new ActiveMQDestination[] { q, t });
broker.start();

activemq_embedded

@marcoaltieri
Copy link
Author

marcoaltieri commented Jul 17, 2018

This is what I can see in jconsole.
image

@titou10titou10
Copy link
Contributor

titou10titou10 commented Jul 17, 2018

Normally with recent versions of ActiveMQ, the Queues are listed in JMX as:
org.apache.activemq:type=Broker,brokerName="<name>",destinationType=Queue,destinationName=<Queue name>

In your case they are named:
localhost:type=Broker,brokerName="<name>",destinationType=Queue,destinationName=<Queue name>

This very strange and this is why JTB does not find them as it is looking for org.apache.activemq:type=Broker,{...} entries.
I also see a "Tomcat" entry in your JMX tree.. Could you tell me how the embedded ActiveMQ instance is created? Some code maybe?

Below the JConsole print screen of my tests with an embedded ActiveMQ from the code I posted earlier

jconsole

@titou10titou10 titou10titou10 added the kind/bug Something isn't working label Jul 20, 2018
@titou10titou10 titou10titou10 added this to the v4.11.0 milestone Jul 20, 2018
@marcoaltieri
Copy link
Author

marcoaltieri commented Jul 21, 2018

Please find in the repository below the code that starts the embedded activemq.

As you can notice, JMSToolBox with the latest commit works: it has been necessary to change the jmxDomainName specified in the configuration for activemq (see ActiveMQ JMX Configuration).

Because the domain name can be modified, wouldn't be better to make it configurable in JMSToolBox as well? If you decide that is not worth, I think it would be better to document this constraint.

https://github.com/marcoaltieri/jmstoolboxtest

@marcoaltieri marcoaltieri changed the title No queues are visible when session is opened on an embedded Apache Active MQ No queues are visible when session is opened on an embedded Apache ActiveMQ Jul 21, 2018
@titou10titou10
Copy link
Contributor

titou10titou10 commented Jul 21, 2018

I can see that in the"activemq.xml"file that the'useJmx="true"'attribute on the"broker"tag is not there. Strange because the JMX MBeans seems to be activated anyway. Maybe this why the "jmxDomainName"does not default to"org.apache.activemq"as said in the doc but is set to"localhost"in your case
The default for'useJmx="true"so everything is ok.

The code changes i made for v4.11.0 should allow JTB to discover the destinations whatever the JMX domain name is.
Could you remove the"jmxDomainName"attribute in your config file and test with JTB v4.11.0 to confirm it works even with a JMX domain name set to something different than"org.apache.activemq"?
Thanks !

Some links:
JMSToolBox setup for ActiveMQ
ActiveMQ Doc on how to activate JMX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working qm/activemq
Projects
None yet
Development

No branches or pull requests

2 participants