On Wed, Aug 15, 2018 at 9:33 AM Sotirios Mantziaris <smantzia...@gmail.com>
wrote:

> I can see over the wire that i get messages from the server with
> Basic.Delivery.
> The messages do not pop up out of the channel that channel.Consume returns
> when creating the connection.
> I might read some where that channels do not play well with threads. I
> wonder if it is the same with goroutines, because i get the messages one
> one goroutine, send it to another via a channel where the messages get Ack
> or Nack.
>
> You said that your application has a similar pattern. Is the channel and
> Ack, Nack on the same goroutine? do you have code that i can look into?
>

My application is internal at work, so I can't share it. But I took a look
at your code and I think this might be your problem:

https://github.com/mantzas/patron/blob/amqp-lock/async/amqp/amqp.go#L119

You are only selecting once on the delivery channel, without a for loop. So
you pull one message and your goroutine exits and never delivers another
message.

You should be fine sharing the messages between goroutines. All that
matters is that the message acks itself back with the tag you set.


>
> On Wednesday, August 15, 2018 at 12:24:18 AM UTC+3, Justin Israel wrote:
>
>>
>>
>> On Wed, Aug 15, 2018 at 8:05 AM Sotirios Mantziaris <smant...@gmail.com>
>> wrote:
>>
>>> I have actually opened a thread in the rabbitmq-users list where i
>>> checked through wireshark what goes over the wire. It is actually pretty
>>> nice to see the flow.
>>> I have cross posted since i did not know if it is rabbitmq or my go
>>> code...
>>> it seems that i get the next message from the wire but the code does not
>>> get it at all...
>>>
>>
>> If I am reading that properly, you are saying that your message handler
>> is not actually getting triggered at all for subsequent messages? That
>> would mean you have some kind of blocking problem in your goroutines and
>> channels. I thought initially you were saying that you verified the handler
>> was constantly receiving messages and calling ack() but the ack never makes
>> it back to Rabbitmq
>>
>>
>>> On Tuesday, August 14, 2018 at 10:59:15 PM UTC+3, Justin Israel wrote:
>>>>
>>>>
>>>>
>>>> On Wed, Aug 15, 2018, 2:14 AM Sotirios Mantziaris <smant...@gmail.com>
>>>> wrote:
>>>>
>>>>> hi,
>>>>>
>>>>> i have setup a "consumer" for a rabbitmq queue. Every delivery is put
>>>>> in a channel which is picked up by a goroutine.
>>>>> After processing the delivery is then Ack or Nack based on the success
>>>>> of the processing.
>>>>> It seems that the first one is processed ok but the rest cannot be
>>>>> Ack/Nack.
>>>>> The ui of rabbitmq shows every message in a unacked state, which
>>>>> probably means that the consumer gets the message from the queue but
>>>>> something prevents it for being put in the above mentioned channel.
>>>>>
>>>>> The consume part of the queue can be found here :
>>>>> https://github.com/mantzas/patron/blob/amqp-lock/async/amqp/amqp.go
>>>>> The processing goroutine can be found here:
>>>>> https://github.com/mantzas/patron/blob/amqp-lock/async/component.go
>>>>>
>>>>> Does anybody have a idea?
>>>>>
>>>>
>>>> I have an application with a similar pattern where is manually acks
>>>> each message after the processing succeeds. So I can check your logic
>>>> against mine. In the meantime, can you clarify if you confirmed that
>>>> processing always happens locally and the ack does get called every time,
>>>> but you are just not seeing it deliver the ack to Rabbitmq?
>>>>
>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "golang-nuts" group.
>>>>>
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to golang-nuts...@googlegroups.com.
>>>>
>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to