Quantcast

SwiftMQ wire-protocol

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SwiftMQ wire-protocol

mikeanthonywild
Hi all,

I have very little Java experience and have been thrown into a project which makes heavy use of JMS / SwiftMQ. I was just wondering if someone could help me understand the protocol stackup a little better as it seems there's a lot going on!

As I understand, JMS a messaging interface standard which describes how Java apps can send / receive messages. SwiftMQ obviously provides such an interface, but I see AMQP mentioned a lot - where does this come into things? Using the SwiftMQ Explorer tool I am able to initiate a connection to -- what I believe to be -- a SwiftMQ router on port 4001. I can see a bit of back-and-forth chatter using Wireshark, but I assume I am not authenticating properly as the remote end just seems to be RSTing the TCP connection.

What format is actually used to send the bits across the wire?

Many thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
SwiftMQ uses it's own - closed - protocol SMQP for JMS. You use JMS over SMQP to communicate with the SwiftMQ Router. AMQP 1.0 is another open protocol for which we have a Java client for.

However, you don't need to wireshark anything if you have a simple connection problem. The cause is probably a wrong connection parameters or a firewall between the Explorer and the SwiftMQ Router.

Tell me more about your parameters and whether you have a firewall in-between.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

mikeanthonywild
Thank you for the quick reply and for clarifying how everything fits together.

Unfortunately the remote is somewhat of a black box to me. I do know that it is using anonymous credentials however. I should clarify that there is no firewall present.

 If I use the example client:
./runclient ../../samples/router_network P2PSender smqp://192.168.56.102:4001 ConnectionFactory testqueue 10
I get the following:
The following parameters are used:

SMQP-URL       : smqp://192.168.56.102:4001
QCF Name       : ConnectionFactory
Queue Name     : testqueue
Number Messages: 10
After which it just hangs. In Wireshark I can see that some sort of keepalive message is being sent back-and-forth every 20s or so.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
Use this URL: smqp:<ip>:4001/timeout=10000

This forces a JNDI timeout after 10 secs and will provide you more infos.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
In reply to this post by mikeanthonywild
smqp://<ip>:4001/timeout=10000
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

mikeanthonywild
Oddly this seems to cause the program to forget the other parameters - it fails trying to connect to localhost instead of 192.168.56.102.
C:\Users\mwild\Downloads\swiftmq_9_7_3_client\scripts\win32>runclient ../../samples/router_network P2PSender smqp://192.168.56.102:4001/timeout=10000 ConnectionFactory testqueue 10

C:\Users\mwild\Downloads\swiftmq_9_7_3_client\scripts\win32>set cp=../../samples/router_network

C:\Users\mwild\Downloads\swiftmq_9_7_3_client\scripts\win32>shift

C:\Users\mwild\Downloads\swiftmq_9_7_3_client\scripts\win32>java -Xmx512M -cp ../../samples/router_network;../../jars/amqp.jar;../../jars/swiftmq.jar;../../jars/jndi.jar;../../jars/jms.jar;../../jars/dom4j-full.jar;../../jars/xstream.jar -Dswiftmq.amqp.frame.debug=false -Dswiftmq.amqp.debug=false P2PSender smqp://192.168.56.102:4001/timeout 10000 ConnectionFactory testqueue 10

The following parameters are used:

SMQP-URL       : smqp://localhost:4001
QCF Name       : plainsocket@router1
Queue Name     : testqueue@router2
Number Messages: 1

Exception: javax.naming.NamingException: unable to connect, exception = javax.jms.JMSException: Unable to create a connection to: [[ServerEntry, hostname=localhost, port=4001]]
From the above snippet, it looks like the URI got mangled? smqp://192.168.56.102:4001/timeout 10000
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
Are you familiar with the shell? runclient.sh is a shell script. You must put the whole URL in quotes.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

mikeanthonywild
I apologise - that was a stupid mistake on my part.

I now get an exception stating that testqueue does not exist. Does SwiftMQ allow for some kind of discovery where I could list the queues provided by the router?

Many thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
Well, it's a bit too much to educate you for everything in SwiftMQ. I suggest start by reading the docs. I assume you've already red the Getting Started docs. Next is SwiftMQ Explorer (here). This is the admin tool to define new queues (Queue Manager Swiftlet). When done, save the config.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

IIT Software
Administrator
In reply to this post by mikeanthonywild
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SwiftMQ wire-protocol

mikeanthonywild
I will read through the docs some more and perhaps try running a test server locally. Thanks.
Loading...