Amazon MQ Destinations Disappearing from ActiveMQ console - activemq

I am new to Amazon MQ and ActiveMQ in general. I have configured my broker to have a composite topic that forwards to multiple queues. I have 3 brokers setup this way. Two out of 3 are working as expected. The third though is acting strange. When I go to view my topics and queues the console is empty. I use an identical XML config file for all 3 brokers being the only difference is the topics and queues names. I think I have persistent mode enabled but not sure I have that setup exactly right. I simply uncommented this line in the XML.
<forcePersistencyModeBrokerPlugin persistenceFlag="true"/>
I also have the <destinations> section filled in with the topics and queues I want created upon restart of the broker. I have noticed that they might show up initially but will eventually disappear from the console unless we maintain messages being written to them. I'm not sure what to look for so hopefully someone can give me some guidance or direction.

Ensure you aren't using gcInactiveDestinations="true" anywhere in your broker configuration as this will delete destinations that are inactive and remove them from the console view. You can read more about deleting inactive destinations in the ActiveMQ documentation.

Related

Can you subscribe and publish to the same ActiveMQ topic

I have a software component that puts a message on a topic - its for 'keep-alive' functionality, testing to see if the components are still running. The component that puts the message on the topic also needs to listen on the same topic. ActiveMQ isn't responding - i.e. the subscribe isn't working for the item that published.
Is there a setting anywhere in ActiveMQ where this functionality can be changed?
We're currently developing on a single node, but will be deploying to multiple nodes, where it will be important for this message to be picked up by the same software component on other nodes, but we haven't tried that yet and don't know if it will work, or how reliable that is. We would be okay if the behaviour was known (i.e. a setting somewhere in the ActiveMQ configuration exists), but we don't.
ActiveMQ has no limitation that would cause this. Check the 'noLocal' setting on your JMS subscriber. If set to 'true' it will ignore messages that are produced from the same connection.
Sounds like you want noLocal=false

Clone RabbitMQ admin users, etc. on replacement server

We have a couple of crusty AWS hosts running a RabbitMQ implementation in a cluster. We need to upgrade the hardware, and therefore we developed a Chef cookbook to spawn replacement servers.
One thing that we would rather not recreate by hand is the admin users, the queues, etc.
What is the best method to get that stuff from the old hosts to the new ones? I believe it's everything that lives in the /var/lib/rabbitmq/mnesia directory.
Is it wise to copy the files from one host to another?
Is there a programmatic means to do this?
Can it be coded into our Chef cookbook?
You can definitely export and import configuration via command line: https://www.rabbitmq.com/management-cli.html
I'm not sure about admin user, though.
If you create new rabbitmq nodes on your new hardware, you will get all the users in that new node. This is easy to try:
run docker container with image of rabbitmq (with management plugin)
and create a user
run another container and add that node to the
cluster of the first one
kill rabbitmq on the first one, or delete
the docker container and you will see that you still have the newly
created user on the 2nd (but now master) node
I wrote docker since it's faster to create a cluster this way, but if you already have a cluster you could use it for testing if you prefer.
For the queues and exchanges, I don't want to quote almost everything found in the rabbitmq doc page for the high availability, but I will just say that you have to pay attention to the following:
exclusive queues because they are gone once the client connection is gone
queue mirroring (if you have any set up, if not it would be wise to consider it, if not even necessary)
I would do the migration gradually, waiting for the queues to get emptied and then kill of the nodes on the old hardware. It maybe doable in a big-bang fashion, but seems riskier. If you have a running system, than set up queue mirroring and try to find appropriate moment to do manual sync - but careful, this has a huge impact on the broker performance.
Additionally there is this shovel plugin (I have to point out that I did not use it or even explore it) but that may be another way to go since (quoting form the link):
In essence, a shovel is a simple pump. Each shovel:
connects to the source broker and the destination broker, consumes
messages from the queue, re-publishes each message to the destination
broker (using, by default, the original exchange name and
routing_key).

activeMQ activemq-admin

how to use "activemq-admin" to view the list of queues; number of messages in the queue;
I read through the tutorial : http://activemq.apache.org/activemq-command-line-tools-reference.html
didn't find a working solution...
and my web console on the slave machine does not work... the web console seems always go with the master machine (in the master/slave structure)
I just want to test that if I send messages into queues on master, slave could update.
so I am trying to use activemq-admin.
The way it works is that Slave is waiting to get a lock to the DB (Kahadb by default) , you will not be able to check the slave , bring down the master and now the slave will become the master broker and you should be able to see all the queues and messages dropped in them (assuming you are using persistence)
You can use JMX, web console or programatically, as you can find here. The easiest solution, I think, is to use web console like here.
I can't understand why isn't accessible the web console. Check for ActiveMQ config xml.
Also you can connect via JMX like:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
Go here for more information.

ActiveMQ Mirrored Queues on separate brokers

Is it possible to set up mirrored queues on different broker instances, residing on different machines? If so, how?
If not, what component(s) might I need to subclass/override to do something homegrown?
Not really sure whay your incentive is for this setup.
If you have multiple brokers in a network, you can't really tell which machine a certain message is on (since it's forwarded to the broker where there is a connected consumer).
If all you need is wiretapping to a totally different ActiveMQ server, you can use Apache Camel for that (it's included in ActiveMQ).
You just need to configure a connector to each ActiveMQ instance.
Actually, in a response to another question, I wrote a small Camel route that copies messages from every queue starting with FOO. to another queue with the name COPY.<queue name>. It might be useful in this case too.

How can I observe what's happening under the hood of ActiveMQ?

I'm experiencing an issue with ActiveMQ and would like to trace/view all ActiveMQ activity. The only log file I can find is one associated with persistent data (if this is turned on). Are there any other log files I view or generate to tell me what's happening under the hood of ActiveMQ and why my consumers aren't consuming messages? Any other suggestions?
Thanks in advance!
activemq has a jmx interface that you can connect to.
this gives us access to consumer counts messages queued dequeue and all sorts of data on memory usage etc.
http://activemq.apache.org/jmx.html
Has all the details to get you started.
I find it excellent in finding out whats going on with activemq.
A quick firing up of jconsole and you will be well on your way to finding out what is going on.
Paul
Agreed. Also you can add the logging interceptor which helps.
Finally for browsing messages, moving them, creating/deleting queues and sending message I highly recommend the new web console for ActiveMQ, Camel and many other plugins: hawtio
Try HawtIO. Assuming you are not using Active MQ 5.9 you can add this feature to your broker. It is a much better web console and a good JMX monitoring utility as well.
http://www.christianposta.com/blog/?p=315