1

私はerlangの初心者ですが、qpid pronton cライブラリを使用してActiveMQをerlangシェルと通信させることができました。これはうまく機能しており、erlangシェルのキュー自体からメッセージを取得しています。

qpidpn:subscribe("amqp://localhost/topic://xxx").
qpidpn:publish(#{address => "amqp://127.0.0.1/topic://xxx", body => "hello"}).

ここで、キューに新しいメッセージがあるたびにいくつかの関数が呼び出される .erl ファイルを使用して、上記と同じコードを実装したいと考えています。

4

2 に答える 2

1

You can implement gen_server, as seems the messages are coming from some MQ. So, you can get the messages in handle_info. Once there you can do whatever you want to do with them.

于 2014-07-22T03:34:22.967 に答える