java - How to "copy" a JMS message to 2 destinations? -


I have a requirement that a JMS message sent by a client is delivered to two systems (one time) reliably should be done. These 2 systems are not HA-enabled, so the best suggestion I've come to:

  1. Create a single queue where customer posts

  2. < P> Set up two "intermediate" queues

  3. Use a custom "duplicator MDB" that will read messages from the client queue and post them in two rows within the same transaction.

 Client-> JMSDQ-> DuplicateMDB-> Q1-> MDB-> System 1-> Q2-> MDB-> System 2 

Is there any existing functionality in it?

The application server is weblogic 10.

I can not do if it will be the proper way to balance the system to keep it stable

Use topics for this because too many messages in cluster subjects will cause duplication . If we have 2 examples, then with the subject it will go like this:

 client-> theme -> MDB1 @ server1-> System1 | \ -> MDB2 @ server1-> System2- ->> MDB1 @ server2-> System 1 \ ---> MDB2 @ server2-> System2 

Thus, every message is called System 1 and System 2 will be delivered twice and if there are 8 servers in the cluster, then every message will be delivered 8 times. This is what I really want to save ...

Finally I got some time to test it and here is what I have seen: 2 nodes in the cluster. 2 JMS server: JMI on node 1, JMS 2 on node 2 Distributed topic DT. MDB with sustainable membership and JM-Client-ID = durable subscriber. System started: 0 message, MDB @ node 1 is up, MDB @ node 2 is trying to connect from time to time, but this can not be because "client id, durable good job is in use" like That is expected. <100 p>

100 messages sent in: jms1 @ dt message current = 0, message total = 100, consumer current = 1 I can see that node processes 1 100 messages.
jms2 @ dt Message current = 100, message total = 100, customer current = 1 means "duplicate" messages are pending in the subject.

Sent in one and 100 messages, 200 processed at 100 node 1, pending at 200 node 2.

Rebooted node 1, MDB @ node 2 reconnected DT and started the process of "pending" messages. 200 messages were processed on node 2.

After node 1, mdb @ node1 can not connect to dt, whereas mdb @ node2 is connected.

jms1 @ dt message current = 0, message total = 0, consumer current = 0
jms2 @ dt message current = 0, message total = 200, consumer current = 1

Send 100 more messages, I see that all 100 messages are processed on node 2 and are rejected on node 1.

jms1 @ dt message current = 0, message total = 100, consumer current = 0
jms2 @dt message current = 0, message total = 300, consumer current = 1

I now reconnect to node 2 reboot, MDB @ node 1dt. After the reboot MDB @ node 2, it is disconnected from DT by connecting to DT and MDB @ node 1.

jms1 @ dt message current = 0, message total = 100, consumer current = 1
jms2 @dt message current = 0, message total = 0, consumer current = 1

I send 100 messages, all are processed on node 2 and stored in topic 1 on node 1:

jms1 @ dt message current = 100, message total = 200, consumer current = 1 - jms2 @ dt Message current = 0, Message total = 0, Consumer current = 1

Then I turn off node 2 and I will be processing 100 nos. Savings Send "behold, when MDB @ node on the subject is 1 reconnect.

The result is: I sent 400 messages, 700 were processed by MDB, out of which 300 were duplicates.

It seems that MDB reconnection works as expected, but the message can be repeated if the "active" MDB hosted the node

This is a bug or weblogic JMS implementation Can be feature.

I have not used weblogic but most of the JMS solutions have a concept of cues and topics, The JMS subject should be the subscriber register and the subject ensures that the message is distributed to each customer once.

Updates: If you are running problems in a package environment, I'm sure everything is configured correctly (here's a guide). It seems strange that when the weblog fails badly in clustering if it is not working, then you can see it in a third party messaging queue, like JMS supports and of course it The problem will not be there.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -