Apache Apollo: java openwire client does not use messages from php stomp manufacturer

I am trying to configure a queue on Apollo 1.6 that will be written to PHP using STOMP and will be used by Java using the openwire ActiveMQ client.

I can read and write in turn with Java, I can read and write to it with PHP, and I can write messages from Java and read them with PHP, but I can not write messages with PHP and read them with Java, this what i really want to do.

When I look at the queue using the Apollo admin UI, I can see all the messages that I send with PHP / STOMP, and with Java / ActiveMQ in the test queue that I created. The codec for php messages is stomping, and for java messages - openwire. My php client reads both types of messages, but my java client does not read stompers.

Here is a gist with a distilled example:

  • Apollo.java reads and writes to the test queue
  • send.php writes to the test queue
  • recv.php reads from the test queue
  • apollo.xml is the apollo configuration used to configure the test queue.

I printed out StompFrames received by php, the first one was sent by java / openwire, the second one was php / stomp:

➜ stomp-php-1.0.0 php -f recv.php Received from /queue/test: StompFrame Object ( [command] => MESSAGE [headers] => Array ( [destination] => [content-length] => 256 [content-type] => protocol/openwire [message-id] => demo-71 ) [body] => {/ID:uspdxml-drevel.local-57993-1378699215106-1:1dtestn{/ID:uspdxml-drevel.local-57993-1378699215106-1:1A O hello! ) ➜ stomp-php-1.0.0 php -f send.php ➜ stomp-php-1.0.0 php -f recv.php Received from /queue/test: StompFrame Object ( [command] => MESSAGE [headers] => Array ( [message-id] => demo-81 [destination] => /queue/test ) [body] => world ) 
+4
source share
1 answer

Apache Apollo is not designed to automatically convert messages based on the selected consumer protocol. The key to understanding this is that Apollo was built into the foundation of the next generation of ActiveMQ. A wide range of functions, such as implicit conversions and other "good to have" functions, can be implemented once / if the Apollo project is combined with ActiveMQ.

From my point of view, you have three alternatives:

  • Use Stomp in java .
  • Switch to ActiveMQ (perhaps painlessly, but with limited performance)
  • Do some kind of manual conversion - for example, using Apache Camel to feed the stomp queue and get the JMS / OpenWire queue.
+2
source

Source: https://habr.com/ru/post/1501235/


All Articles