Hi David,
the process 1 follow: ...
the process 2 follow:
...

Ok. That code looks fine. So, when you run that, process 2 receives a
basic.cancel? And if you remove the process_flag(...) in process 1, it
doesn't? That sounds very strange and shouldn't happen.

When you say "receives a basic.cancel", do you mean that process 2 exits
with an non-normal message? Could you post the exact message if so?

Is there anything like an error in the RabbitMQ or SASL logs?

Also, what version of the server and client are you using?

Cheers,
Alex

On Fri, Feb 10, 2012 at 09:59:23AM +0000, Liuzhuofu wrote:
Hi Alex:

the process 1 follow:
process_flag(trap_exit, true),
....
...
{ok, Tag, Pid} = tcloud_mq_amqp_func:tc_subdesc_queue(ReadChannel, Que, MFA), %% subscribe the queue with process 2 start with MFA
%% and after this code, the process 1 do nothing but wait for call/cast process 1 is a gen_server.
%% process 1 never do unbind/delete opertion to the queue or any other thing


the process 2 follow:
loop() -> %% loop/0 is the F of MFA that start the process 2
receive
Msg ->
io:format("Msg:~p~n", [Msg]),
loop()
end

Regard
David


________________________________________
???: Alexandru Scvor?ov [scvalex at gmail.com] ?? Alexandru Scvor?ov [alexandru at rabbitmq.com]
????: 2012?2?10? 17:38
?: Liuzhuofu
Cc: rabbitmq-discuss at lists.rabbitmq.com
??: Re: [rabbitmq-discuss] Can't process_flag(trap_exit, true) in process

Hi David,
I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.
I don't follow. Are you saying that running "process_flag(trap_exit,
true)" in process 1, the queue will get deleted immediately (and hence
process 2 will receive a basic.cancel)?

Could you post your code please?

Cheers,
Alex
On Fri, Feb 10, 2012 at 08:22:10AM +0000, Liuzhuofu wrote:
Hi all:
I found a strange thing:
I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.
Why ?

Regards,
David
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedFeb 10, '12 at 8:22a
activeFeb 10, '12 at 10:36a
posts4
users2
websiterabbitmq.com
irc#rabbitmq

2 users in discussion

Alexandru Scvorţov: 2 posts Liuzhuofu: 2 posts

People

Translate

site design / logo © 2018 Grokbase