[rabbitmq-discuss] RabbitMQ and Spring
Arno Puschmann
arno.puschmann at acodeas.de
Fri Aug 5 08:51:33 BST 2011
> Can you be more specific?
I use this Code
template.setExchange("exchange");
template.setQueue("someQueue");
template.setRoutingKey("someQueue");
Message response = template.sendAndReceive("exchange", "anotherQueue" , message);
Because I couldn't find any manual about template.sendAndReceive, I believe that the message is written on the Queue which is set through the parameters and Messages are read from the Queue which is set Default through template.setQueue and template.setExchange.
After this my response is Null, although there is a message on the Queue.
During the Receive I get this Error on my Management Plugin
Got response code 500 with body {"error":"JSON encode error: {bad_term,<0.6351.1>}","reason":"While encoding:\n[[{memory,4128},\n {owner_pid_details,[{name,<<\"127.0.0.1:46088\">>},\n {peer_address,<<\"127.0.0.1\">>},\n {peer_port,46088}]},\n {idle_since,<<\"2011-8-5 9:20:6\">>},\n {exclusive_consumer_pid,<0.6351.1>},\n {exclusive_consumer_tag,<<\"c4df9e97-a433-4011-8287-723181e0b0af\">>},\n {messages_ready,0},\n {messages_unacknowledged,0},\n {messages,0},\n {consumers,1},\n {backing_queue_status,{struct,[{q1,0},\n {q2,0},\n {delta,[delta,undefined,0,undefined]},\n {q3,0},\n {q4,0},\n {len,0},\n {pending_acks,0},\n {outstanding_txns,0},\n {target_ram_count,infinity},\n {ram_msg_count,0},\n {ram_ack_count,0},\n {ram_index_count,0},\n {next_seq_id,0},\n {persistent_count,0},\n {avg_ingress_rate,0.0},\n {avg_egress_rate,0.0},\n {avg_ack_ingress_rate,0.0},\n {avg_ack_egress_rate,0.0}]}},\n {name,<<\"amq.gen-hBMby7Fm+ry0WBI3SZVelA==\">>},\n {vhost,<<\"/\">>},\n {durable,false},\n {auto_delete,true},\n {arguments,{struct,[]}},\n {node,'rabbit at apuschmann-laptop'}],\n [{memory,34072},\n {idle_since,<<\"2011-8-5 9:20:7\">>},\n {exclusive_consumer_pid,''},\n {exclusive_consumer_tag,''},\n {messages_ready,3},\n {messages_unacknowledged,0},\n {messages,3},\n {consumers,0},\n {backing_queue_status,{struct,[{q1,0},\n {q2,0},\n {delta,[delta,0,0,0]},\n {q3,0},\n {q4,3},\n {len,3},\n {pending_acks,0},\n {outstanding_txns,0},\n {target_ram_count,infinity},\n {ram_msg_count,3},\n {ram_ack_count,0},\n {ram_index_count,0},\n {next_seq_id,4},\n {persistent_count,3},\n {avg_ingress_rate,0.0040401263408916714},\n {avg_egress_rate,0.0},\n {avg_ack_ingress_rate,0.0},\n {avg_ack_egress_rate,0.0}]}},\n {message_stats,[{publish,1}]},\n {name,<<\"bla\">>},\n {vhost,<<\"/\">>},\n {durable,true},\n {auto_delete,false},\n {arguments,{struct,[]}},\n {node,'rabbit at apuschmann-laptop'}],\n [{memory,6352},\n {idle_since,<<\"2011-8-5 9:13:4\">>},\n {exclusive_consumer_pid,''},\n {exclusive_consumer_tag,''},\n {messages_ready,1},\n {messages_unacknowledged,0},\n {messages,1},\n {consumers,0},\n {backing_queue_status,{struct,[{q1,0},\n {q2,0},\n {delta,[delta,0,0,0]},\n {q3,0},\n {q4,1},\n {len,1},\n {pending_acks,0},\n {outstanding_txns,0},\n {target_ram_count,infinity},\n {ram_msg_count,1},\n {ram_ack_count,0},\n {ram_index_count,0},\n {next_seq_id,5},\n {persistent_count,0},\n {avg_ingress_rate,0.0},\n {avg_egress_rate,0.0531915006790427},\n {avg_ack_ingress_rate,0.0},\n {avg_ack_egress_rate,0.0}]}},\n {name,<<\"blub\">>},\n ............and so on........
After a Refresh this error is gone.
The Message is written on the Queue but, the other Message isn't read.
On the same Queues with template.send and template.receive it works fine.
> If you use SpringSource ToolSuite it
>should work (but you might need to use an explicit version number in
>your schema declaration - i.e. */spring-rabbit-1.0.xsd).
Im using SpringSource ToolSuite with the decleration
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd">
but the same behaviour.
Thanks again.
More information about the rabbitmq-discuss
mailing list