Send Active MQ messages throught Camel that were sent to a AMQ topic while Camel was down - jms

I have configured an Active MQ server that puts messages to a determined topic, in that moment a configured Camel server take this message and send it by a route to another server, the issue happens when Camel server is down and the Active MQ still continues putting messages in the topic and when Camel starts these past messages are not read by Camel, is there any way to configure Camel to start and read past messages from this Active MQ Server?

Its ActiveMQ / JMS questions. Take a look at durable topics
http://activemq.apache.org/how-do-durable-queues-and-topics-work.html

Related

How to automatically read/receive message from solace queue when application started?

I want to automatically read/receive messages from solace queue/topic if any message produced or published when my application is up. So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic.
So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic
This is not possible for JMS.
JMS applications initiate a connection to the broker and receive messages over the locally initiated connection.
The only way to do what you want is to use REST instead of JMS.
When a REST consumer is configured, the Solace event broker will initiate a HTTP connection to the application.
A sample can be found here:
https://solace.com/samples/solace-samples-rest-messaging/publish-subscribe/

Apache Camel JMS/AMQP component create destination queue only if required

I am currently working on an Integration application that uses Camel with Spring Boot. There is a camel route in integration application that receive messages from source Artemis broker that is transformed and sent to another Artemis broker.
The camel route looks like this:
from(sourceQueue).process(transformProcessor).to(destinationQueue)
When the camel route starts, it recreates the queue names mentioned in the from and to and the previous messages are lost. We do not expect this to happen.
One way I found to do this is in the Artemis ActiveMQ broker.xml, disable the queue and topic auto creation and create the queue(s) using Artemis API.
My question is, can we configure camel JMS / AMQP component to create the queue only if it is not present and if present use the existing ones?
By default Camel will use DynamicDestinationResolver. You can create your own custom DestinationResolver and plug it in your endpoint (or into your component)
.to("jms:queue:myQueue?destinationResolver=MyCustomDestinationResolver");
You can also use JndiDestinationResolver, which by default does not fallback into creating a dynamic destination.
I don't know Artemis but it sounds weird for a broker to delete a queue with its messages. At least its "brother" ActiveMQ has by default the behavior you expect: queues are automatically created if they do not exist, but they just stay if they already exist.
Are you sure the queues are recreated on route start? Are these queues persistent? Could it be that a consumer just drains the queue? I also found a queue attribute of Artemis named auto-delete-queues that would delete the queue if it was drained by a consumer.
auto-delete-queues Whether or not to the broker should automatically delete auto-created JMS queues when they have both 0 consumers and 0 messages.

Is It possible if i have put message to ActiveMq jms and consume it from RabbitMq jms?

I am new to jms,
I have did poc of spring jms with ActiveMq. In which I am producing messages in queue and consume it using consumer and one poc in which I am using spring jms with rabbitmq with producer and consumer and have added plugin of jms in rabbit mq to use spring jms with rabbitmq.
Is it Possible if I put Produce message in active MQ and Consume that messages using spring jms rabbitmq consumer?
Is It possible if yes then How?
Thanks in advance.
ActiveMQ and RabbitMQ are two different brokers - why do you need (and why do you think it's possible) to send messages to one broker and receive them from another?
You would need another application to move the messages; it's not clear why you would want to do that.
Typically, you would need an adapter layer to move the JMS messages from one MQ to another (i.e., active MQ to Rabbitmq etc.).
You can look here for some notes (IBM specific) on JMS adapters, but the underlying concept is the same i.e., consuming from one MQ and producing the messages to another MQ.

Receiving messages from WSO2 Message Broker with Process Server

I successfully configured WSO2 Message Broker as a JMS server. I have configured WSO2 ESB to send messages to a queue, and I can see this queue get created in MB with messages.
Now, I want to consume those messages with Process Server and kick off a BPEL process. I have added the required libraries to components/lib in both ESB and BPS, and have created an identical jndi.properties in both. The URL for both ESB and BPEL is:
jms:/newMLECaseQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=queue
I have tested a similar configuration with ActiveMQ, and there BPEL succesfully picked up the messages. In MB it does not seem to work, while the logging mentions that JMS started to listen:
Started to listen on destination : newMLECaseQueue of type queue for service newMLECaseQueue {org.apache.axis2.transport.jms.JMSListener}
What can be wrong here?
It appears that each queue must be registered using jndi.properties: when adding the queue with the line:
queue.newMLECaseQueue = newMLECaseQueue
it all started to work.

Bridge between ActiveMQ and MSMQ

Let's say there is an ActiveMQ as JMS broker which is fed by a master system based on java.
One of the consumers can work with MSMQ only (and we can do nothing with it)
Question Is there an easy way to forward jms text in jms messages in ActiveMQ topic to some message at MSMQ destination?
Underlying jms message contains the text of an xml file.
Depends a bit on your preferences, but a simple Camel route in ActiveMQ dispatching messages to MSMQ can do this easily - GIVEN you run your AMQ on Windows.
Camel does not really support MSMQ, but you can use some simple java lib to dispatch messages inside a java processor.

Resources