• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
This is my favorite show. And this is my favorite tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic