I'm trying to setup a queue on Apollo 1.6 that will be written to from PHP using STOMP and consumed by Java using the ActiveMQ openwire client.
I can read and write to my queue from Java, I can read and write to it from PHP, and I can write messages with Java and read them with PHP, but I cannot write messages from PHP and read them with Java which is what I really want to do.
When I look at the queue using Apollo's admin UI I can see all the messages I post with PHP/STOMP and with Java/ActiveMQ in the test queue I have created. The codec for the php messages is stomp and for the java messages it is openwire. My php client reads both types of messages, but my java client does not read the stomp ones.
Here is a gist with a distilled example:
- Apollo.java reads and writes to test queue
- send.php writes to test queue
- recv.php reads from test queue
- apollo.xml is the apollo configuration used to set up the test queue.
I printed out the StompFrames received by php, the first was posted by java/openwire, the second by 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
)