2016-07-08 15 views
4

camel-amqp(version 2.17)コンポーネントを使って私のラクダルートでrabbitmqに接続しようとしています。ラクダを使ったラビットMQ接続amqp

私は以下のようにそれを設定している:

@Bean 
    CachingConnectionFactory jmsCachingConnectionFactory(){ 

     JmsConnectionFactory pool = new JmsConnectionFactory(); 
     pool.setRemoteURI("amqp://127.0.0.1:5672"); 
     pool.setUsername("guest"); 
     pool.setPassword("guest"); 

     CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(); 
     cachingConnectionFactory.setTargetConnectionFactory(pool); 
     return cachingConnectionFactory; 
    } 

    @Bean 
    JmsConfiguration jmsConfig(){ 

     JmsConfiguration configuration = new JmsConfiguration(); 
     configuration.setConnectionFactory(jmsCachingConnectionFactory()); 
     // configuration.setCacheLevelName("CACHE_CONSUMER"); 
     return configuration; 
    } 

    @Bean 
    AMQPComponent amqp(){ 
     AMQPComponent component = new AMQPComponent(); 
     component.setConfiguration(jmsConfig()); 
     return component; 
    } 

私は取得していますエラーがある

javax.jms.JMSException:既存の接続を強制的 でリモートホスト によって閉じられました(JmsExceptionSupport.java:66) 〜[qpid-jms-client-0.8.0.jar:0.8.0]

私RabbitMQのログでは、私は

を理解することはできませんよ下のメッセージ*

** Reason for termination == 
** {function_clause, 
     [{rabbit_amqp1_0_link_util,'-outcomes/1-lc$^0/1-0-', 
      [{list, 
       [{symbol,<<"amqp:accepted:list">>}, 
        {symbol,<<"amqp:rejected:list">>}, 
        {symbol,<<"amqp:released:list">>}, 
        {symbol,<<"amqp:modified:list">>}]}], 
      [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]}, 
     {rabbit_amqp1_0_link_util,outcomes,1, 
      [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]}, 
     {rabbit_amqp1_0_outgoing_link,attach,3, 
      [{file,"src/rabbit_amqp1_0_outgoing_link.erl"},{line,41}]}, 
     {rabbit_amqp1_0_session_process,with_disposable_channel,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,377}]}, 
     {rabbit_amqp1_0_session_process,handle_control,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,197}]}, 
     {rabbit_amqp1_0_session_process,handle_cast,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,134}]}, 
     {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1049}]}, 
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]} 
=ERROR REPORT==== 8-Jul-2016::17:09:27 === 
closing AMQP connection <0.29082.0> (127.0.0.1:55479 -> 127.0.0.1:5672): 
{handshake_error,running,<0.29104.0>, 
    {{symbol,<<"amqp:internal-error">>}, 
    "Session error: ~p~n~p~n", 
    [function_clause, 
     [{rabbit_amqp1_0_link_util,'-outcomes/1-lc$^0/1-0-', 
      [{list, 
       [{symbol,<<"amqp:accepted:list">>}, 
       {symbol,<<"amqp:rejected:list">>}, 
       {symbol,<<"amqp:released:list">>}, 
       {symbol,<<"amqp:modified:list">>}]}], 
      [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]}, 
     {rabbit_amqp1_0_link_util,outcomes,1, 
      [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]}, 
     {rabbit_amqp1_0_outgoing_link,attach,3, 
      [{file,"src/rabbit_amqp1_0_outgoing_link.erl"},{line,41}]}, 
     {rabbit_amqp1_0_session_process,with_disposable_channel,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,377}]}, 
     {rabbit_amqp1_0_session_process,handle_control,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,197}]}, 
     {rabbit_amqp1_0_session_process,handle_cast,2, 
      [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,134}]}, 
     {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1049}]}, 
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]]}} 

を見ることができます*

私はRabbitMQの中amqp_1_0プラグインを有効にしています。 誰かがこれを解決する手助けをすることができますか?

+0

ラクダの成分があります。なぜあなたはそれを使わないのですか? –

+0

Camel-rabbitmqは完璧に動作しますが、唯一の問題はトランザクションサポートが見当たらないことです。コンポーネントに自分のtxマネージャを設定する方法がありません。私がamqpを見て唯一の理由は、txをサポートしているjmsコンポーネントを使用しているからです。 – VGaur

+0

RabbitMQは、AMQPトランザクションが非常に遅いため、AMQPトランザクションの使用を奨励しています。開発者自身の言葉で言えば、スループットを250 ** **減少させます!私はそれがこの問題であなたを助けないことを知っているが、私の提案は、autoAckオプションをオフにして、[publisher confirms enabled](https://www.rabbitmq.com/confirms.html)でRabbitMQを試してみることであろう。確認はCamelのバージョン2.17.0以降でサポートされています。詳しくは、[RabbitMQコンポーネントのドキュメント](https://camel.apache.org/rabbitmq.html)を参照してください。 –

答えて

関連する問題