Hi Bruno,
The reported NPE can only occur when there is no AMQP protocol plugin
available in the broker classpath. Thus, the broker cannot support any AMQP
connectivity. Though, instead of NPE, the more correct behaviour would be
to report that no AMQP protocol plugin is available. However, it is a bit
unexpected use case. The broker is supposed to run with a support for at
least one AMQP protocol.
As per AMQP specifications (for both legacy ones and new AMQP 1.0), the
Broker is obligated to reply with the latest supported AMQP protocol
version in response to unsupported version request. In this particular
case, the broker supported protocol was "null" which cased an NPE :(
Adding a dependency for
"qpid-broker-plugins-amqp-1-0-protocol-bdb-link-store" only adds a support
for AMQP 1.0, as module
"qpid-broker-plugins-amqp-1-0-protocol-bdb-link-store" depends on
"qpid-broker-plugins-amqp-1-0-protocol".
For AMQP 0-9, you need to add a broker pluging implementing support for
AMQP 0-8,0-9 and 0-91:
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
<version>${qpid-broker-version}</version>
</dependency>
That should resolve the NPE exception.
Kind Regards,
Alex
On Mon, 10 Feb 2020 at 11:48, queimadus <[email protected]> wrote:
> Hi Alex,
>
> My client (com.rabbitmq.amqp-client) is using the 0.9.1 protocol and I'm
> including the `qpid-broker-core`,
> `qpid-broker-plugins-amqp-1-0-protocol-bdb-link-store` and
> `qpid-broker-plugins-memory-store` at version `7.1.5` (We have another
> dependency which relies on a inferior version of `com.fasterxml.jackson` so
> we couldn't use `7.1.7`).
>
> This is my current config is:
> ```
> {
> "name": "TestBroker",
> "modelVersion": "7.1",
> "defaultVirtualHost": "default",
>
> "authenticationproviders" : [{
> "secureOnlyMechanisms": [],
> "name": "plain",
> "type": "Plain",
> "users": [
> {
> "id": "03eb68b8-8e9c-42e0-a7d0-70d436ba22af",
> "type": "managed",
> "name": "${qpid.user.name}",
> "password": "${qpid.user.password}"
> }
> ]
> }],
>
> "ports" : [ {
> "name" : "AMQP",
> "port" : "${qpid.amqp_port}",
> "authenticationProvider" : "plain",
> "virtualhostaliases" : [ {
> "name" : "nameAlias",
> "type" : "nameAlias"
> }, {
> "name" : "defaultAlias",
> "type" : "defaultAlias"
> }, {
> "name" : "hostnameAlias",
> "type" : "hostnameAlias"
> } ]
> }],
>
> "virtualhostnodes" : [{
> "name" : "default",
> "type" : "JSON",
> "defaultVirtualHostNode" : "true",
> "virtualHostInitialConfiguration" : "{\"type\": \"Memory\"}",
> "preferenceStoreAttributes": {"type": "Noop"}
> }]
>
> }
> ```
>
> And without the `qpid-broker-plugins-amqp-1-0-protocol-bdb-link-store`
> dependency I get exceptions of this type:
> ```
> Exception in thread "IO-/0:0:0:0:0:0:0:1:59163"
> java.lang.NullPointerException
> at
>
> org.apache.qpid.server.transport.MultiVersionProtocolEngine$SelfDelegateProtocolEngine.received(MultiVersionProtocolEngine.java:467)
> at
>
> org.apache.qpid.server.transport.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:135)
> at
>
> org.apache.qpid.server.transport.NonBlockingConnection.processAmqpData(NonBlockingConnection.java:611)
> at
>
> org.apache.qpid.server.transport.NonBlockingConnectionPlainDelegate.processData(NonBlockingConnectionPlainDelegate.java:58)
> at
>
> org.apache.qpid.server.transport.NonBlockingConnection.doRead(NonBlockingConnection.java:496)
> at
>
> org.apache.qpid.server.transport.NonBlockingConnection.doWork(NonBlockingConnection.java:270)
> at
>
> org.apache.qpid.server.transport.NetworkConnectionScheduler.processConnection(NetworkConnectionScheduler.java:134)
> at
>
> org.apache.qpid.server.transport.SelectorThread$ConnectionProcessor.processConnection(SelectorThread.java:575)
> at
>
> org.apache.qpid.server.transport.SelectorThread$SelectionTask.performSelect(SelectorThread.java:366)
> at
>
> org.apache.qpid.server.transport.SelectorThread$SelectionTask.run(SelectorThread.java:97)
> at
>
> org.apache.qpid.server.transport.SelectorThread.run(SelectorThread.java:533)
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at
>
> org.apache.qpid.server.bytebuffer.QpidByteBufferFactory.lambda$null$0(QpidByteBufferFactory.java:464)
> at java.lang.Thread.run(Thread.java:748)
> ```
>
> At first, I tried to see if I was missing a dependency that added support
> for 0.9.1 but as far as I can tell, that seems to be supported natively.
> Since adding that dependency fixed that issue I didn't delve much more into
> that.
>
> Thanks,
> Bruno
>
>
>
> --
> Sent from:
> http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>