Using MQ Light with Swiftmq AMQP 1.0 client API

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using MQ Light with Swiftmq AMQP 1.0 client API

excess2k
Hi,

I've been trying to do a basic connect to MQ Light with SwiftMQ AMQP 1.0 client API.

I may be missing something obvious.

My code (in Scala):
   val log = LoggerFactory.getLogger(this.getClass)
    val ctx = new AMQPContext(AMQPContext.CLIENT);
    val connection = new Connection(ctx, "localhost", 5672, "mqlight", "admin");
    connection.setContainerId("client")
    connection.setSocketFactory(new PlainSocketFactory)
    connection.setMechanism("PLAIN")
    connection.connect()


The exception:
Exception in thread "main" com.swiftmq.amqp.v100.client.AuthenticationException: AuthenticationException: SASLOutcome code=1
        at com.swiftmq.amqp.v100.client.Connection.connect(Unknown Source)
        ...

From the AMQP spec we know that SASLOutcome code=1 means Connection authentication failed due to an unspecified problem with the supplied
credentials.

And here is the full debug output:
ConnectionDispatcher, , visit, po=[POProtocolRequest, header=[ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]] ...
ConnectionDispatcher, , visit, po=[POProtocolRequest, header=[ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]] done
amqp, SND: [ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]
amqp, RCV: [ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]
ConnectionDispatcher, , visit, po=[POProtocolResponse, header=[ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]] ...
ConnectionDispatcher, , visit, po=[POProtocolResponse, header=[ProtocolHeader, name=AMQP, id=3, major=1, minor=0, revision=0]] done
ConnectionDispatcher, , visit, po=[POAuthenticate, mechanism=PLAIN, username=mqlight, password=admin] ...
ConnectionDispatcher, , visit, po=[POAuthenticate, mechanism=PLAIN, username=mqlight, password=admin] done
amqp, RCV[0] (size=24): [SaslMechanisms saslServerMechanisms=[PLAIN]]
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[SaslMechanisms saslServerMechanisms=[PLAIN]], sassl=true] ...
ConnectionVisitor, , visit=[SaslMechanisms saslServerMechanisms=[PLAIN]]
amqp, RCV[0] (size=16): [SaslOutcome mycode=1]
amqp, RCV: [ProtocolHeader, name=AMQP, id=0, major=1, minor=0, revision=0]
amqp, RCV[0] (size=40): [Open containerId=PlainText, hostname=, maxFrameSize=4294967295, channelMax=65535, idleTimeOut=30000]
ConnectionDispatcher, , close ...
ConnectionDispatcher, , close ...
ConnectionDispatcher, , close in progress, return
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[SaslMechanisms saslServerMechanisms=[PLAIN]], sassl=true] done
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[SaslOutcome mycode=1], sassl=true] ...
ConnectionVisitor, , visit=[SaslOutcome mycode=1]
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[SaslOutcome mycode=1], sassl=true] done
ConnectionDispatcher, , visit, po=[POProtocolResponse, header=[ProtocolHeader, name=AMQP, id=0, major=1, minor=0, revision=0]] ...
ConnectionDispatcher, , visit, po=[POProtocolResponse, header=[ProtocolHeader, name=AMQP, id=0, major=1, minor=0, revision=0]] done
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[Open containerId=PlainText, hostname=, maxFrameSize=4294967295, channelMax=65535, idleTimeOut=30000], sassl=false] ...
ConnectionVisitor, , visit=[Open containerId=PlainText, hostname=, maxFrameSize=4294967295, channelMax=65535, idleTimeOut=30000]
ConnectionDispatcher, , visit, po=[POConnectionFrameReceived, frame=[Open containerId=PlainText, hostname=, maxFrameSize=4294967295, channelMax=65535, idleTimeOut=30000], sassl=false] done
ConnectionDispatcher, , visit, po=[POConnectionClose] ...
ConnectionDispatcher, , visit, po=[POConnectionClose] done
ConnectionDispatcher, , close done
Exception in thread "main" com.swiftmq.amqp.v100.client.AuthenticationException: AuthenticationException: SASLOutcome code=1
        at com.swiftmq.amqp.v100.client.Connection.connect(Unknown Source)
        at com.monitise.s2s.Main$.main(Main.scala:22)
        at com.monitise.s2s.Main.main(Main.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)


Many thanks for any help!