Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Ian Barber
On Mon, Dec 12, 2011 at 7:51 PM, Andrei Zmievski wrote:

> Ian, did you mean to say "the other benefit of using PUSH/PULL"?
>
> -Andrei
>

No, I meant pub/sub. Just making the point there are some use cases PUBSUB
is better for, but I would generally go for push pull. Clear advice always
:)

Ian
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Andrei Zmievski
Ian, did you mean to say "the other benefit of using PUSH/PULL"?

-Andrei

On Mon, Dec 12, 2011 at 11:46 AM, Ian Barber  wrote:

>
> The other benefit of using PUB/SUB is that you can connect to multiple
> SUBs if need be, and they can select messages (or get all). This is the
> reason mongrel2 uses it. Like Mikko says, if you use the noblock then you
> can just drop messages in HWM state manually without much difficulty, and
> you'll benefit from knowing that's happened (unlike in the PUBSUB case) -
> but if you connected multiple PULL sockets, the messages would load balance
> between them.
>
> Ian
>
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Ian Barber
On Mon, Dec 12, 2011 at 7:27 PM, Mikko Koppanen wrote:

> On Mon, Dec 12, 2011 at 6:30 PM, Andrei Zmievski 
> wrote:
> > I actually don't need to do subscription filtering, but I also don't
> want to
> > block on HWM, so that's why I was thinking of PUB-SUB model.
>
>
> Hi,
>
> pub-sub will work for this scenario. If the Java process is something
> that can be distributed you could explore PUSH (clients) and PULL
> (server) for high-availability and splitting the load. You can still
> do non-blocking writes or polling with timeout with PUSH.


The other benefit of using PUB/SUB is that you can connect to multiple SUBs
if need be, and they can select messages (or get all). This is the reason
mongrel2 uses it. Like Mikko says, if you use the noblock then you can just
drop messages in HWM state manually without much difficulty, and you'll
benefit from knowing that's happened (unlike in the PUBSUB case) - but if
you connected multiple PULL sockets, the messages would load balance
between them.

Ian
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Mikko Koppanen
On Mon, Dec 12, 2011 at 6:30 PM, Andrei Zmievski  wrote:
> I actually don't need to do subscription filtering, but I also don't want to
> block on HWM, so that's why I was thinking of PUB-SUB model.


Hi,

pub-sub will work for this scenario. If the Java process is something
that can be distributed you could explore PUSH (clients) and PULL
(server) for high-availability and splitting the load. You can still
do non-blocking writes or polling with timeout with PUSH.

-- 
Mikko Koppanen
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Andrei Zmievski
I actually don't need to do subscription filtering, but I also don't want
to block on HWM, so that's why I was thinking of PUB-SUB model.

-Andrei

On Mon, Dec 12, 2011 at 10:12 AM, Ian Barber  wrote:

> On Mon, Dec 12, 2011 at 6:09 PM, Ian Barber  wrote:
>
>> On Mon, Dec 12, 2011 at 5:51 PM, Andrei Zmievski wrote:
>>
>>> I have several C worker processes that need to send data to a single
>>> Java process that will collect and aggregate it. I was thinking of binding
>>> on a SUB socket in the Java process and then connecting to the same
>>> endpoint on a PUB socket in each C one. Would this work or is there a
>>> better pattern for this?
>>>
>>> -Andrei
>>>
>>
>> It would work, but you'll probably find binding a PULL socket and having
>> multiple processes PUSH to it will be a better bet, unless you want the
>> drop on HWM properties of pubsub.
>>
>> Ian
>>
>
> Oh, and hey Andrei! The other thing that comes to mind is if you wanted to
> filter messages on your SUB side with the subscription matching. But you
> would probably be better served by push/pull for most cases.
>
> Ian
>
>
>
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Ian Barber
On Mon, Dec 12, 2011 at 6:09 PM, Ian Barber  wrote:

> On Mon, Dec 12, 2011 at 5:51 PM, Andrei Zmievski wrote:
>
>> I have several C worker processes that need to send data to a single Java
>> process that will collect and aggregate it. I was thinking of binding on a
>> SUB socket in the Java process and then connecting to the same endpoint on
>> a PUB socket in each C one. Would this work or is there a better pattern
>> for this?
>>
>> -Andrei
>>
>
> It would work, but you'll probably find binding a PULL socket and having
> multiple processes PUSH to it will be a better bet, unless you want the
> drop on HWM properties of pubsub.
>
> Ian
>

Oh, and hey Andrei! The other thing that comes to mind is if you wanted to
filter messages on your SUB side with the subscription matching. But you
would probably be better served by push/pull for most cases.

Ian
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Ian Barber
On Mon, Dec 12, 2011 at 5:51 PM, Andrei Zmievski wrote:

> I have several C worker processes that need to send data to a single Java
> process that will collect and aggregate it. I was thinking of binding on a
> SUB socket in the Java process and then connecting to the same endpoint on
> a PUB socket in each C one. Would this work or is there a better pattern
> for this?
>
> -Andrei
>

It would work, but you'll probably find binding a PULL socket and having
multiple processes PUSH to it will be a better bet, unless you want the
drop on HWM properties of pubsub.

Ian
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Multiple PUB -> one SUB?

2011-12-12 Thread Andrei Zmievski
I have several C worker processes that need to send data to a single Java
process that will collect and aggregate it. I was thinking of binding on a
SUB socket in the Java process and then connecting to the same endpoint on
a PUB socket in each C one. Would this work or is there a better pattern
for this?

-Andrei
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev