铲除AMQP 1.0至AMQP 0.9.1错误匹配错误utf8

时间:2018-01-13 12:28:12

标签: rabbitmq activemq rabbitmq-shovel

环境:

RabbitMQ 3.7.2(AMQP 0.9.1)

Erlang 20.1.7.1

ActiveMQ 5.14.3(AMQP 1.0)

RabbitMQ和ActiveMQ在同一主机(Debian)中运行

我用AMQP 1.0作为源(ActiveMQ)和AMQP 0.9.1作为目标(RabbitMQ)创建了一把铲子。 RabbitMQ成功连接到ActiveMQ队列(我将其视为消费者)但是一旦我在队列中发送消息(ActiveMQ),它立即断开连接并且我有一个错误的匹配错误。

我用动态和静态铲子进行了测试

铲子配置:

shovel config

日志

2018-01-10 19:14:50.780 [info] <0.6986.0> accepting AMQP connection <0.6986.0> (127.0.0.1:49951 -> 127.0.0.1:5772)


2018-01-10 19:14:50.788 [info] <0.6986.0> Connection <0.6986.0> (127.0.0.1:49951 -> 127.0.0.1:5772) has a client-provided name: Shovel

2018-01-10 19:14:50.789 [info] <0.6986.0> connection <0.6986.0> (127.0.0.1:49951 -> 127.0.0.1:5772 - Shovel): user 'admin' authenticated and granted access to vhost '/'

2018-01-10 19:15:33.478 [info] <0.6974.0> terminating static worker with {{badmatch,{'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}}},[{rabbit_amqp10_shovel,handle_source,2,[{file,"src/rabbit_amqp10_shovel.erl"},{line,180}]},{rabbit_shovel_worker,handle_info,2,[{file,"src/rabbit_shovel_worker.erl"},{line,78}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1047}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}

2018-01-10 19:15:33.479 [info] <0.6986.0> closing AMQP connection <0.6986.0> (127.0.0.1:49951 -> 127.0.0.1:5772 - Shovel, vhost: '/', user: 'admin')

2018-01-10 19:15:33.479 [error] <0.6974.0> ** Generic server <0.6974.0> terminating

** Last message in was {amqp10_msg,{link_ref,receiver,<0.6979.0>,0},{amqp10_msg,{'v1_0.transfer',{uint,0},{uint,0},{binary,<<"0">>},{uint,0},undefined,undefined,undefined,undefined,undefined,undefined,undefined},{'v1_0.header',undefined,{ubyte,0},undefined,undefined,undefined},undefined,{'v1_0.message_annotations',[{{symbol,<<"x-opt-jms-dest">>},{byte,0}}]},{'v1_0.properties',{utf8,<<"ID:ip-10-205-167-133-37813-1515610971654-5:2:1:1:1">>},undefined,{utf8,<<"queue://sourcequeue">>},{utf8,<<>>},undefined,{utf8,<<>>},undefined,undefined,undefined,{timestamp,1515611733475},undefined,undefined,undefined},undefined,{'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}},undefined}}

** When Server state == {state,undefined,undefined,undefined,undefined,{<<"/">>,<<"Foo">>},dynamic,#{ack_mode => on_confirm,dest => #{current => {<0.6982.0>,<0.6999.0>,<<"amqp://localhost:5772/%2F">>},dest_queue => <<"destqueue">>,fields_fun => #Fun<rabbit_shovel_parameters.11.26683091>,module => rabbit_amqp091_shovel,props_fun => #Fun<rabbit_shovel_parameters.12.26683091>,resource_decl => #Fun<rabbit_shovel_parameters.10.26683091>,unacked => #{},uris => ["amqp://admin:admin@localhost:5772/%2F"]},name => <<"Foo">>,reconnect_delay => 5,shovel_type => dynamic,source => #{current => #{conn => <0.6976.0>,link => {link_ref,receiver,<0.6979.0>,0},session => <0.6979.0>,uri => "amqp://admin:admin@localhost:5672/?sasl=anon"},delete_after => never,last_acked_tag => -1,module => rabbit_amqp10_shovel,prefetch_count => 1000,remaining => unlimited,remaining_unacked => unlimited,source_address => <<"sourcequeue">>,uris => ["amqp://admin:admin@localhost:5672/?sasl=anon"]}},undefined,undefined,undefined,undefined,undefined}

** Reason for termination ==

** {{badmatch,{'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}}},[{rabbit_amqp10_shovel,handle_source,2,[{file,"src/rabbit_amqp10_shovel.erl"},{line,180}]},{rabbit_shovel_worker,handle_info,2,[{file,"src/rabbit_shovel_worker.erl"},{line,78}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1047}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}

2018-01-10 19:15:33.480 [error] <0.6974.0> CRASH REPORT Process <0.6974.0> with 0 neighbours exited with reason: no match of right hand value {'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}} in rabbit_amqp10_shovel:handle_source/2 line 180 in gen_server2:terminate/3 line 1161

2018-01-10 19:15:33.480 [error] <0.930.0> Supervisor {<0.930.0>,rabbit_shovel_dyn_worker_sup} had child {<<"/">>,<<"Foo">>} started with rabbit_shovel_worker:start_link(dynamic, {<<"/">>,<<"Foo">>}, [{<<"ack-mode">>,<<"on-confirm">>},{<<"dest-add-forward-headers">>,false},{<<"dest-protocol">>,<<"...">>},...]) at <0.6974.0> exit with reason no match of right hand value {'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}} in rabbit_amqp10_shovel:handle_source/2 line 180 in context child_terminated

2018-01-10 19:15:33.480 [info] <0.6976.0> Conn handle_info {'EXIT',<0.6974.0>,{{badmatch,{'v1_0.amqp_value',{utf8,<<"<message>Foo</message>">>}}},[{rabbit_amqp10_shovel,handle_source,2,[{file,"src/rabbit_amqp10_shovel.erl"},{line,180}]},{rabbit_shovel_worker,handle_info,2,[{file,"src/rabbit_shovel_worker.erl"},{line,78}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1047}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}} close_sent

0 个答案:

没有答案