-
1. Re: PHP Stomp client (Hornetq 2.2.5 Final)
gaohoward Nov 9, 2011 2:56 AM (in response to chernser)Do you have a test to run?
Howard
-
2. Re: PHP Stomp client (Hornetq 2.2.5 Final)
chernser Nov 9, 2011 3:01 AM (in response to gaohoward)Unfortunatly at home and only these two scripts (java and php). Is suitable as test?
-
3. Re: PHP Stomp client (Hornetq 2.2.5 Final)
gaohoward Nov 9, 2011 3:02 AM (in response to chernser)Sure, please attach the scripts and I can take a look.
Thanks
Howard
-
4. Re: PHP Stomp client (Hornetq 2.2.5 Final)
chernser Nov 9, 2011 4:47 AM (in response to gaohoward)I've made eclipse project and attached it to my post.
To run it you need:
1. add hornetq client libs
2. installed php (I have 5.3)
Run php_sender.php from project's root, because it uses Stomp lib from it.
Thanks in advance!
-
5. Re: PHP Stomp client (Hornetq 2.2.5 Final)
gaohoward Nov 9, 2011 8:44 AM (in response to chernser)Thanks for the test. I think I know what's happening with your code. In Client.java you need to reset the reader index each time you have read it. And you need to get the message content using getNullableSimpleString() method. like:
byte[] body = new byte[message.getBodySize()];
message.getBodyBuffer().readBytes(body);
message.getBodyBuffer().resetReaderIndex();
SimpleString str = message.getBodyBuffer().readNullableSimpleString();
Howard
-
6. Re: PHP Stomp client (Hornetq 2.2.5 Final)
chernser Nov 9, 2011 9:12 AM (in response to gaohoward)Thank you!
It works now. The problem with out of bound exception was because I've been using not `readNullableSimpleString()` method, but `readString()` to read content (In "production" code I read content only once).