Preserve Msg Unit of Order Property from Source ActiveMQ to Weblogic Queue via Bridge - jms

I need to maintain message processing order from an ActiveMQ to Weblogic Queue via Bridge.
I tried setting JMS_BEA_UnitOfOrder property from source and enabled Preserve Msg Property in the bridge configuration. However, I still could not see this property when message in coming in destination Queue. Need suggestion on this.
Bridge Config below:

Related

Messages in Virtual Topic not consumed by consumer queue

I am trying to use a queue in activemq to dequeue messages from a virtual topic. I tried sending some messages and it is showing up in the topic under "message enqueued" but it is not able to be consumed.
The virtual topic name that i created was VirtualTopic.AA and the consumer is called Consumer.client1.VirtualTopic.AA.
In the consumer.client1.VirtualTopic.AA, i can see that there is a consumer but it is just not able to dequeue messages from the virtual topic.
Anyone knows why this is happening ? Do i need to change some settings in the configuration in the xml file ?
When you publish to a virtual topic using Spring's JmsTemplate, you need to configure it for a topic by setting the pubSubDomain property to "true".
From the JmsTemplate documentation:
If you want to use dynamic destination creation, you must specify the type of JMS destination to create, using the "pubSubDomain" property. For other operations, this is not necessary. Point-to-Point (Queues) is the default domain.
And in JmsDestinationAccessor#setPubSubDomain:
pubSubDomain - "true" for the Publish/Subscribe domain (Topics), "false" for the Point-to-Point domain (Queues)

Does Spring XD re-process the same message when one of it's container goes down while processing the message?

Application Data Flow:
JSon Messages--> Active MQ --> Spring XD-- Business Login(Transform JSon to Java Object)--> Save Data to Target DB--> DB.
Question:
Sprin-Xd is running in cluster mode, configured with Radis.
Spring XD picks up the message from the Active message queue(AMQ). So message is no longer in AMQ. Now while one of the containers where this message is being processed with some business logic suddenly goes down. In this scenarios-
Will Spring-XD framework automatically re-process that particular message ? what's mechanism behind that?
Thanks,
Abhi
Not with a Redis transport; Redis has no infrastructure to support such a requirement ("transactional" reads). You would need to use a rabbit or kafka transport.
EDIT:
See Application Configuration (scroll down to RabbitMQ) and Message Bus Configuration.
Specifically, the default ackMode is AUTO which means messages are acknowledged on success.

jms point to point or JMS publisher and subscriber

I am a novice user for jmeter.
In my company i need to do load testing. I am using Hermes JMS to send request and response using the queues. So what should I use in jmeter, jms point to point or JMS publisher and subscriber. And I also want to set up the ftp location to get the files.
I tried both of those but getting the error in jndi properties:
"ERROR - jmeter.protocol.jms.sampler.JMSSampler: org.apache.activemq.jndi.ActiveMQInitialContextFactory javax.naming.NameNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory"
I am not exactly sure how can I set up the queues that I am using in hermes.
How can I setup the JNDI settings? Or its default because I was reading online and everyone has Initial Context Factory as org.apache.activemq.jndi.ActiveMQInitialContextFactory and what about the queues do I need to provide my own queues or that's the default as well?
If you are using queues, you'll want to use JMS point to point. JMS publisher and subscriber uses JMS topics. If the queues already exist in ActiveMQ (and they appear to since you can see them in Hermes), you'll need to configure JMeter to use those. It sounds like your JNDI settings are incorrect and JMeter cannot find the JNDI name you're telling it to look for.
Regarding the 2nd part of your question: when using a JMS Publisher, you can use the dynamicQueues/ prefix for your destination when creating queues, dynamicTopics/ for topics, e.g. dynamicQueues/my.testqueue
You need to make sure that you have the 'activemq-all-[version].jar' file in the lib folder of JMeter so that when you set the 'Initial Context Factory' property to 'org.apache.activemq.jndi.ActiveMQInitialContextFactory' (as well as the 'QueueConnection Factory' resource to 'ConnectionFactory') in the JMS Sampler the latter is found and initiated by JMeter.

Websphere equivalent for Weblogic bridge level message filter

In weblogic it is possible to create a message bridge between two JMS message queues. While configuring this bridge, a message filter can be applied so that the bridge will route messages that match the filter only.
Is it possible to achieve the same with Websphere?
Specifically I'm trying to achieve this scenario.
I have one source queue on which messages are received. Each message will have a custom JMS property set up. I would like to forward the messages on the source queue, to separate queues based on the JMS property and its value. This is easily configured in WLS using message bridges with filtering. How can I do the same in WAS?
Thanks
Savio
You need to use SIB Mediation.
The WAS info center have an example called writing a routing mediation which seems like what you need.
At the bottom of the example there is a link to what to do next which also explains how to configure WAS to use that mediation.
Without writing custom code (as per your comment on Aviram's answer), it is not possible to achieve the exact same thing, but nonetheless it is possible to achieve same effect;
You say that a 'source queue' distributes messages to other 'separate queues' according to a custom JMS property. I'm assume that you have MDBs (message driven beans) configured to process messages in these separate queues.
What you can do with WebSphere is distribute messages to these MDBs directly from the 'source queue', without having to filter/distribute them to separate queues.
This is managed by using JMS Message Selectors. You can point all your MDBs to the source queue using activation specification definitions, and for each (one for each type of message) MDB, define a JMS Message Selector that matches the ones you use in WLS. This way each message is only delivered the MDB whose filter matches the message's properties. This effectively filters/distributes messages to different MDB's as in WLS.
You may read details on configuring message selectors (during development in RAD, or at/after deploy time) at infocenter. Below is a quote to give you an idea about what it look like;
messageSelector
This attribute determines the JMS message selector
that is used to select which messages the message-driven bean
receives. For example:
JMSType='car' AND color='blue' AND weight>2500
The selector string can refer to fields in the JMS message header and
fields in the message properties. Message selectors cannot reference
message body values.
For the record, we finally ended up writing our own routing algorithm within the application to ensure that messages are sent to separate queues for each client. This way we are independent of app server implementations and the integration effort is the same across app servers, viz., adding custom queues per integrating client.
In brief, We published a JMS custom property that must be set. Using a published convention, we look up for a queue and send responses to the queue. If the property is not set, a default queue is created to route all messages. If the property is set, and the queue cannot be found an exception is raised and processing halted.
This suited our purpose. Hope it helps...

Not able to create jms queues in websphere programatically using standalone java client

I wrote a java client to connect to jms in websphere.
I was able to connect and produce and consume message.
Problem I am facing is when I do Session.createQueue(), websphere jms is not creating a new queue.
Please could some one throw some light on this issue...
Thanks in advance...
If you are working with WebSphere MQ as the messaging provider within WebSphere Application Server the queue will need to be created on the WebSphere MQ QueueManager first. This can be done either via the graphical WMQ Explorer or via the command line using the 'runmqsc' tool.
Information can be found for these via the WMQ InfoCentre - suggest doing a websearch for "WMQ Library" to get the latest link, currently though it is http://www-01.ibm.com/software/integration/wmq/library/index.html
Topics though don't need to be pre-created - though they can be if required. Various properties can be set different to the default.
If the Queue doesn't need to be permanent, for example as a temporary reply to then look into creating a temporary queue from the JMS Connection.
createQueue doesn't create a new queue. It simply creates a javax.jms.Queue object from a vendor specific identifier. javax.jms.Queue objects are just references to existing queues. Typically, you retrieve javax.jms.Queue objects from JNDI; createQueue is only useful in scenarios where using JNDI is not possible or not desirable.
Note: there is one exception to this, namely JMS providers that support autocreation of queues (I think ActiveMQ has such a feature).

Resources