Continuous connection between consumer and producer

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Continuous connection between consumer and producer

Ravi Pandey
Hi

I have a question - How to keep continuous connection between consumer and producer?

I mean when producer sends messages - consumer process it and send back with callback queue if I used rpc procedure and connection will closed.

Now I want connection between consumer and producer should be open. How to achieve this?

Thanks

_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Tim Watson-6
Producers and consumers are typically decoupled in messaging systems, but the presence of an intermediary (i.e., the broker). What client library/language are you using? The connections between the producer/broker and consumer/broker will be as long-lived as the code that sets them up and closes them.

Cheers,
Tim 

On 10 Apr 2014, at 12:06, Ravi Pandey wrote:

Hi

I have a question - How to keep continuous connection between consumer and producer?

I mean when producer sends messages - consumer process it and send back with callback queue if I used rpc procedure and connection will closed.

Now I want connection between consumer and producer should be open. How to achieve this?

Thanks
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Michael Klishin-2
In reply to this post by Ravi Pandey
 On 10 April 2014 at 15:10:03, Ravi Pandey ([hidden email]) wrote:
> > I mean when producer sends messages - consumer process it and  
> send back with callback queue if I used rpc procedure and connection  
> will closed.

The request/reply pattern does not assume either publisher or producer
has to close the connection.

> Now I want connection between consumer and producer should be  
> open. How to achieve this?

Have a consumer for replies in the publisher app. Note that the notion
of “connection between producer and consumer” is not really true: both are
connected to RabbitMQ and communicate with messages asynchronously.
--  
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Ravi Pandey
In reply to this post by Tim Watson-6
I am using php-amqplib


On Thu, Apr 10, 2014 at 5:07 PM, Tim Watson <[hidden email]> wrote:
Producers and consumers are typically decoupled in messaging systems, but the presence of an intermediary (i.e., the broker). What client library/language are you using? The connections between the producer/broker and consumer/broker will be as long-lived as the code that sets them up and closes them.

Cheers,
Tim 

On 10 Apr 2014, at 12:06, Ravi Pandey wrote:

Hi

I have a question - How to keep continuous connection between consumer and producer?

I mean when producer sends messages - consumer process it and send back with callback queue if I used rpc procedure and connection will closed.

Now I want connection between consumer and producer should be open. How to achieve this?

Thanks
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Tim Watson-6
On 10 Apr 2014, at 12:57, Ravi Pandey wrote:

> I am using php-amqplib
>

That's perhaps why we see this "disconnecting" business then, since PHP doesn't support long-lived connections. Not sure what you can do about that, given the way PHP works. Perhaps someone with more PHP expertise can comment?

As Michael points out though, it's really not an issue when working with request/reply queues, since the connection does not have to be long-lived in order for this to work.

Cheers,
Tim
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Ravi Pandey
I want connection between consumer and producer to be open. My requirement is to send messages to producer, so my assumption is that if connection between them is open forever then I can send messages through that open connection :)


On Thu, Apr 10, 2014 at 5:51 PM, Tim Watson <[hidden email]> wrote:
On 10 Apr 2014, at 12:57, Ravi Pandey wrote:

> I am using php-amqplib
>

That's perhaps why we see this "disconnecting" business then, since PHP doesn't support long-lived connections. Not sure what you can do about that, given the way PHP works. Perhaps someone with more PHP expertise can comment?

As Michael points out though, it's really not an issue when working with request/reply queues, since the connection does not have to be long-lived in order for this to work.

Cheers,
Tim
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Continuous connection between consumer and producer

Michael Klishin-2
On 10 April 2014 at 16:31:38, Ravi Pandey ([hidden email]) wrote:
> > I want connection between consumer and producer to be open.  
> My requirement is to send messages to producer, so my assumption  
> is that if connection between them is open forever then I can send  
> messages through that open connection :)

Perhaps we should reiterate.

 * There is *no* direct connection from producer to consumer. Both connect to RabbitMQ.
 * PHP’s request model makes it at least challenging to keep long-lived connections
 * Consumers which do not run as part of the Web server can and should use long lived connections 
--  
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss