You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Markus Wolf <ma...@sinnerschrader.com> on 2010/09/07 16:17:58 UTC

PubSub with multiple responses

Hi there,

I would like to ask if there is a possibility to have multiple responses in
a pubsub setup? Or is this only possible to send the responses to another
queue/topic and listen to that?
I could not find any example on the website.

Regards
Markus Wolf
-- 
Markus Wolf, Developer
markus.wolf@sinnerschrader.com

T +49.40.39 88 55 - 324

SinnerSchrader Deutschland GmbH
Völckersstraße 38, D-22765 Hamburg
Amtsgericht Hamburg HRB-Nr. 63663
Geschäftsführer: Matthias Schrader (Sprecher), Holger Blank,
Laurent Burdin, Thomas Dyckhoff, Chris Wallon
Büros: Hamburg, Frankfurt am Main

http://www.sinnerschrader.de | Creating Radical Relationships.

Re: PubSub with multiple responses

Posted by Markus Wolf <ma...@sinnerschrader.com>.
Ok, to give some more information on this I script what we want to do:

We have a scenario in which we want a message spread out and handled by
multiple clients (pubsub). Each of this clients could respond to the message
and the requesting part should aggregate all responses and handle upon the
result of this operation.
I know that normaly in a pubsub no responses are used and in a naive
approach for a prove-of-concept I struggled with it, since only one response
is returned by the camel ProducerTemplate. Would it solve the problem to
implemented an own ProducerComponent aggregating all responses into one? I
hoped I could get around this work.

Regards
Markus Wolf

2010/9/7 Ashwin Karpe <as...@progress.com>

>
> Hi,
>
> It is possible to be both a publisher and subscriber on the same topic. If
> you are trying to apply a request/response based communication model in a
> pub/sub or queueing environment, then you need to use Correlation Id's to
> match the responses to a given request. More importantly, you need to use a
> response queue or topic to ensure the response is sent and received by the
> right entity (client).
>
> However the bigger point is, pub/sub is not generally used for
> request/response scenarios. Queues are more preferable since pub/sub
> involves dispatch of a single message to several subscribers each of whom
> may independently act on the message oblivious to the activities of other
> subscribers causing unnecessary duplication of message handling.
>
> Also responses will be dispatched to all subscribers unless you use
> response
> topics and control the clients subscribing to the response topic, causing
> flooding in the environment. This is bad for scalability and seriously
> damage performance.
>
> Hope this helps.
>
> Cheers,
>
> Ashwin...
>
>
>
> -----
> ---------------------------------------------------------
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> Progress Software Corporation
> http://fusesource.com http://fusesource.com
>
> Blog: http://opensourceknowledge.blogspot.com.com
> http://opensourceknowedge.blogspot.com
> ---------------------------------------------------------
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/PubSub-with-multiple-responses-tp2806150p2806172.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Markus Wolf, Developer
markus.wolf@sinnerschrader.com

T +49.40.39 88 55 - 324

SinnerSchrader Deutschland GmbH
Völckersstraße 38, D-22765 Hamburg
Amtsgericht Hamburg HRB-Nr. 63663
Geschäftsführer: Matthias Schrader (Sprecher), Holger Blank,
Laurent Burdin, Thomas Dyckhoff, Chris Wallon
Büros: Hamburg, Frankfurt am Main

http://www.sinnerschrader.de | Creating Radical Relationships.

Re: PubSub with multiple responses

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

It is possible to be both a publisher and subscriber on the same topic. If
you are trying to apply a request/response based communication model in a
pub/sub or queueing environment, then you need to use Correlation Id's to
match the responses to a given request. More importantly, you need to use a
response queue or topic to ensure the response is sent and received by the
right entity (client).

However the bigger point is, pub/sub is not generally used for
request/response scenarios. Queues are more preferable since pub/sub
involves dispatch of a single message to several subscribers each of whom
may independently act on the message oblivious to the activities of other
subscribers causing unnecessary duplication of message handling.

Also responses will be dispatched to all subscribers unless you use response
topics and control the clients subscribing to the response topic, causing
flooding in the environment. This is bad for scalability and seriously
damage performance. 

Hope this helps.

Cheers,

Ashwin...



-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
Progress Software Corporation
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com.com
http://opensourceknowedge.blogspot.com 
---------------------------------------------------------
-- 
View this message in context: http://camel.465427.n5.nabble.com/PubSub-with-multiple-responses-tp2806150p2806172.html
Sent from the Camel - Users mailing list archive at Nabble.com.