aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes In Publisher and subcriber messaging, can many to many communication happen? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "In Publisher and subcriber messaging, can many to many communication happen?" Watch "In Publisher and subcriber messaging, can many to many communication happen?" New topic
Author

In Publisher and subcriber messaging, can many to many communication happen?

venkatesh seshagiri
Greenhorn

Joined: Jun 05, 2003
Posts: 7
Hi All
To elaborate more, i have two applications. Each application can be either a publisher or subscriber.
Let the names of the applications be A and B.
Application A publishes messages for topic T1. Then Application B listens to topic T1. Here A is publisher for T1 and B is Subscriber for T1. every thing works fine.
Application B publishes messages for topic T2. Application A listens to topic T2. Here too every thing works fine.
Now both applications run simultaneously. Application A publishes T1 and Subscribes T2. Similarly Application B publishes T2 and Subscribes to T1. Here too every thing works fine.
Now i am encountering a situation where in Application A should publish T1 and T2 and subscribe to T1 and T2 selectively. This applies for application B also.
I would like to know whether this kind of set up is possible or not?
Is there a way by which when Application A publishes T2 it should not subscribe to the the same topic T2. That means it should avoid loop back for topics.
For more clarification if anybody need more information please let me know.
I am using openJms as the Jms server.
Two applications are normal java appliactions.
T1 topis for new objects created in application A.
T2 topics for new objects created in application B.
Now T2 is subscribed in application A. Objects such saved can be modified in A application which should again get published and subscribed by B application. This is where i am facing difficulty.
Thanks for any kind of inputs on this issue.
S Venkatesh
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi venkatesh seshagiri ,
Yes. I guess your situation can be handled by different Message Types.
e.g.
message type format- <<origin app>>_<<operation code>>
1. MessageType2 = A_ADDED
- Objects possessed originally by A when published to T1, by A, has this message type
2. MessageType1 = A_MODIFIED
- Objects possessed originally by B, modified by A, published to T2, by A, has this message type
3. MessageType4 = B_ADDEd
- Objects possessed originally by B when published to T2, by B, has this message type
4. MessageType3 = B_MODIFIED
- Objects possessed originally by A, modified by B, published to T1, by B, has this message type

Does this make sense?
Regards
Maulin
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
There is a JMS option to recieve messages from the client that sent them. This is exactly what this is for.
I forget the specifics because it's been so long, but take a look. It's specific to ClientID or the other ID (subscription ID). I can't remember. Either way, there IS a way to specify when creating the subscription.
venkatesh seshagiri
Greenhorn

Joined: Jun 05, 2003
Posts: 7
Thanks for the inputs and thye are helpful
I am still exploring how to make the publisher from not subscribing the same topic it has published.
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
You can always tweak the message header to take care of this scenario.
Concentrate on the structure of the messages and you will have it working.
Kishore.


Kishore
SCJP, blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In Publisher and subcriber messaging, can many to many communication happen?