On 07/25/2012 08:21 PM, dejanb [via ActiveMQ] wrote:
> Can you try the latest snapshot and confirm it works for you
>
> https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/5.7-SNAPSHOT/
>

Looks like progress.  My old stomp 1.0 client can connect, login and 
send a message to ActiveMQ 5.7-SNAPSHOT.

Unfortunately it then throws:

      [java] Jul 25, 2012 10:00:59 PM 
org.apache.activemq.transport.stomp.ProtocolConverter handleException
      [java] WARNING: Exception occurred processing:
      [java] SEND
      [java] amq-msg-type:MapMessage
      [java] transformation:jms-map-json
      [java] destination:/queue/integration.account_update
      [java] transformation-error:org/xmlpull/v1/XmlPullParserException
      [java]
      [java] 
{"map":{"entry":[{"string":["update_type","ad...2","GB"]}]}}: 
org.apache.activemq.transport.stomp.ProtocolException: Unsupported 
message type 'MapMessage'

I've seen this before and don't think I ever worked a way around it.

To try to get around this, I updated my PHP client to the latest from 
the github repo, and dropped it into my client e-commerce site lib 
directory, and put together a basic test using the 
stomp-php/src/examples/transformation.php as a guide. (the 'namespace', 
'use' and 'auto_loader' stuff is completely foreign to me, and I wasted 
some time trying to get it to work .. the require_once and 
FuseSource\Stomp\Stomp syntax runs, at least)

         ini_set('include_path', ini_get('include_path') . 
PATH_SEPARATOR . 'lib' . PATH_SEPARATOR . 'lib/FuseSource');
         require_once("Stomp/Stomp.php");
         require_once("Stomp/Frame.php");
         require_once("Stomp/Message.php");
         require_once("Stomp/Message/Map.php");
         // make a connection to ActiveMQ
         if ($dbg) error_log("Making connection to " . 
ACTIVEMQ_STOMP_URL . "...");
         $con = new FuseSource\Stomp\Stomp(ACTIVEMQ_STOMP_URL);
         // connect
         $con->connect(ACTIVEMQ_USERNAME, ACTIVEMQ_PASSWORD);

         // real data $body = array('map' => array('entry' => $entries));
         $body = array('test' => 'foo', 'othertest' => 1234); // dummy data

         $header = array('transformation' => 'jms-map-json');
         $mapMessage = new FuseSource\Stomp\Message\Map($body, $header);
         if ($dbg) error_log("Calling send...");
         $con->send("/queue/integration.account_update", $mapMessage, 
array());

This caused the server to receive a message, but it's not of type 
javax.jms.MapMessage:

      [java] Jul 25, 2012 10:30:29 PM 
ltd.yavin.liveauction.jms.GenericConsumer onMessage
      [java] INFO: XXX message class 
org.apache.activemq.command.ActiveMQTextMessage: ActiveMQTextMessage 
{commandId = 3, responseRequired = false, messageId = 
ID:uberneek-33640-1343230073443-8:3:-1:1:1, originalDestination = null, 
originalTransactionId = null, producerId = 
ID:uberneek-33640-1343230073443-8:3:-1:1, destination = 
queue://integration.account_update, transactionId = null, expiration = 
0, timestamp = 1343230229732, arrival = 0, brokerInTime = 1343230229732, 
brokerOutTime = 1343230229733, correlationId = null, replyTo = null, 
persistent = false, type = null, priority = 4, groupID = null, 
groupSequence = 0, targetConsumerId = null, compressed = false, userID = 
null, content = null, marshalledProperties = null, dataStructure = null, 
redeliveryCounter = 0, size = 1059, properties = 
{transformation-error=org/xmlpull/v1/XmlPullParserException, 
transformation=jms-map-json}, readOnlyProperties = true, readOnlyBody = 
true, droppable = false, text = {"test":"foo","othertest":1234}}

My server then rejects the message, because it's coded to only accept 
MapMessage objects.

I can see the conversation going over the wire via wireshark:

CONNECT
login:zencart
passcode:premierrange

.CONNECTED
heart-beat:0,0
session:ID:uberneek-33640-1343230073443-8:4
server:ActiveMQ/5.7-SNAPSHOT
version:1.0

.
SEND
transformation:jms-map-json
destination:/queue/integration.account_update

{"test":"foo","othertest":1234}.DISCONNECT

.

Assuming I'm going to stick with the new client and use Stomp 1.1, can 
you suggest why the message being sent isn't recognised as a MapMessage 
on the server side?

I'm sure part of the point here was to show that 5.7-SNAPSHOT can 
communicate with the old 1.0 Stomp client.  This failed for me but I'm 
not sure if you want me to do further debugging, as it failed within the 
activemq code and I presume you can reproduce that error on your system 
and debug far better than I can.

Nick




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/5-5-to-5-6-upgrade-stomp-client-suddenly-gets-User-name-xyz-or-password-is-invalid-tp4654229p4654357.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to