Re: Ack,Redelivery,sessionTransacted--- Consumer Slowly!!!

2016-08-09 Thread Tim Bain
I'm sorry, but I have no idea what question you're asking.  Could you
explain in more detail?

A few things to start with:

   - What do you mean by "So there is a problem here :"?
   - What do you mean by "sessionTransacted must set the value true. if not
   Redelivery Invalid"?
   - What do you mean by "All Messages Dequeued until previous message
   redilivery completed."?

Tim

On Tue, Aug 9, 2016 at 12:45 AM, jacky.wang <654979...@qq.com> wrote:

> hi all.
> Rqurement Case:
> Consumer consumed message until logic method called successful.
> Flow Chart:1.Producer send message - > 2.MessageListner - onMessage() ->
> 3.call  logic method successfully -> 4.then Ack() -> 5.message consumed or
> dequeued
>
> DefaultMessageListener Container config:
>  class="org.springframework.jms.listener.
> DefaultMessageListenerContainer">
>  />
> 
>  ref="consumerMessageListener" />
>
> 
> 
>
> sessionTransacted must set the value true. if not Redelivery Invalid。
> So there is a problem here :
> All Messages Dequeued until previous message redilivery completed. so my
> consumer is slowly.
>
> Best Regards.
>
>
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Ack-Redelivery-sessionTransacted-Consumer-Slowly-tp4715220.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: Monitor ActiveMQ Brokers

2016-08-09 Thread khokhani
I think you can explore the Jolokia REST API bundled with ActiveMQ base
installation. Your monitoring system can make REST calls to get various
matrices to alert support groups.  



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Monitor-ActiveMQ-Brokers-tp4715114p4715269.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Issue with ActiveMQ 5.13.0 - Jetty(9.2.13.v20150730.jar)

2016-08-09 Thread khokhani
I think many developers choose to use Jetty for web console and Jolokia REST
API while security it with JAAS plug-in. 

What is way forward to security of ActiveMQ web console and Jolokia REST
API? 
Isn't it devops problem to maintain right version and add those jars to
activemq installation?

Please provide your inputs best practices, thanks.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Issue-with-ActiveMQ-5-13-0-Jetty-9-2-13-v20150730-jar-tp4706895p4715267.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Performance issue when selecting messages over 3000+

2016-08-09 Thread methodho
Here is the scenario:
1. Start a standalone activemq server (memory persistence)
2. Enqueue 3000+ message to a queue
3. Dequeue by selector (JMSCorrelationID='...'), and the performance is
REALLY bad.

It seems like MessageConsumer is waiting MessageDispatchChannel to get all
the messages from server.

So in this case, How can I solve the problem?

Thanks





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Performance-issue-when-selecting-messages-over-3000-tp4715224.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Ack,Redelivery,sessionTransacted--- Consumer Slowly!!!

2016-08-09 Thread jacky.wang
hi all.
Rqurement Case:
Consumer consumed message until logic method called successful.
Flow Chart:1.Producer send message - > 2.MessageListner - onMessage() ->
3.call  logic method successfully -> 4.then Ack() -> 5.message consumed or
dequeued

DefaultMessageListener Container config:








sessionTransacted must set the value true. if not Redelivery Invalid。
So there is a problem here :
All Messages Dequeued until previous message redilivery completed. so my
consumer is slowly.

Best Regards.








--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Ack-Redelivery-sessionTransacted-Consumer-Slowly-tp4715220.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Artemis as multiprotocol broker

2016-08-09 Thread Martyn Taylor
Hi Luca,

The feature is supported.  The issue was how you were configuring your
client.

There are two versions of MQTT that are supported in Artemis: 3.1 and
3.1.1.  In 3.1.1 the protocol handshake (or ID), the first couple of bytes
sent by the client changed.  So, you must specify the corresponding version
and protocol ID in your client.

// For MQTT 3.1.1 this is
protocolId: "MQTT"
protocolVersion: 4

or

// For MQTT 3.1 - old version
protocolId: MQIsdp
protocolVersion: 3

The issue was that your client was specifying:

protocolId: MQTT
protocolVersion: 3

This does not match any protocol, hence the error you are seeing.

I modified your javascript to configure your client like below and it
worked for me.

  var client = mqtt.connect('ws://localhost:1883', {
  protocolId: 'MQTT'
, protocolVersion: 4
  });

Can you update accordingly and let me know if it works.

Thanks
Martyn

On Tue, Aug 9, 2016 at 3:11 PM, Luca Capra  wrote:

> Hi Martyn, all
>
> sorry for taking on from such an old thread, but as of today with
> 1.4-SNAPSHOT I've not been able to have MQTT over websocket to work
>
> I continue to receive a debug notice like this
>
> - Requested subprotocol(s) not supported: MQTT
> - Requested subprotocol(s) not supported: mqttv3.1.1
> - Requested subprotocol(s) not supported: mqtt
> - ... many other tentatives
>
> Is it the subprotcol name that is not matching or is this feature actually
> not supported?
>
> I'm trying to have the broker to talk from a web browser to the broker and
> still mqtt over ws seems the best way.
> Do you have any suggestion ?
>
> Thank you!
>
>
>
> 2016-05-31 18:50 GMT+02:00 Martyn Taylor :
>
> > Hi Luca,
> >
> > You are seeing the error because you are not setting the correct version
> > and protocol header in your client.  Your client should set:
> >
> > ProtocolID="MQTT" and ProtocolVersion=4   // 3.1.1
> > or
> > ProtocolID="MQlsdp" and ProtocolVersion=3 // 3,1
> >
> > Artemis will accept both protocol versions (which are practically
> > identical) but both point to the 3.1.1 implementation.  Your mileage may
> > vary with 3.1.  I suggest always using 3.1.1.
> >
> > line 15853 of your js should be:
> >
> >   var client = mqtt.connect('ws://localhost:1883', {
> > protocolId: 'MQTT
> > , protocolVersion: 4
> >   });
> >
> > Instead of:
> >
> >   var client = mqtt.connect('ws://localhost:1883', {
> > protocolId: 'MQTT' // or 'MQIsdp' in MQTT 3.1.1
> > , protocolVersion: 4 // or 3 in MQTT 3.1
> >   }); // you add a ws:// url here
> >
> > Note the protocol ID in 3.1.1 is "MQTT".
> >
> > I made these changes locally and it works fine for me.
> >
> > Thanks
> > Martyn
> >
> > On Tue, May 31, 2016 at 2:04 PM, Luca Capra 
> wrote:
> >
> > > Hi,
> > >
> > > I tried to setup the mqttjs library and run it in a browser.
> > > Unfortunately, it tries to connect over websocket and artemis cannot
> > > recognize the subprotocol
> > >
> > > The source is here: http://pastebin.com/Jgeijbz9
> > >
> > > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker -
> [id:
> > > 0x8958b0d5, /127.0.0.1:60138 => /127.0.0.1:1883] WebSocket version V13
> > > server handshake
> > > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker -
> > > WebSocket version 13 server handshake key: pJTCBulMMJvyCoIpj2wEPg==,
> > > response: 6vRlkIXEqz7ihckJ2TFuB6V9uhY=
> > > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker -
> > > Requested subprotocol(s) not supported: mqttv3.1
> > >
> > >
> > > In the latest master the issue with the client disconnecting is still
> > > there, but the error message is slightly different. In 1.2 it used to
> > work
> > >
> > > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > > io.netty.util.internal.JavassistTypeParameterMatcherGenerator -
> > Generated:
> > >
> > > io.netty.util.internal.__matchers__.io.netty.handler.
> > codec.mqtt.MqttMessageMatcher
> > > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > > org.apache.activemq.artemis.core.protocol.mqtt - SESSION CREATED:
> > > d2cd94e9-3d23-4a85-bb53-53528cd9fcb1
> > > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > > org.apache.activemq.artemis.core.protocol.mqtt - Bad Message
> > Disconnecting
> > > Client
> > >
> > >
> > > Thank you
> > >
> > > Regards
> > > Luca
> > >
> > >
> > > 2016-05-27 13:25 GMT+02:00 Luca Capra :
> > >
> > > > Hi Martyn,
> > > > I will bundle the js all in a page for testing.
> > > >
> > > > I think the js library will try to interact with "mqtt over
> websockets"
> > > > from the browser.
> > > > (See just one line above here,
> > > > https://github.com/mqttjs/MQTT.js#contributing)
> > > >
> > > > 

Re: Artemis as multiprotocol broker

2016-08-09 Thread Luca Capra
Hi Martyn, all

sorry for taking on from such an old thread, but as of today with
1.4-SNAPSHOT I've not been able to have MQTT over websocket to work

I continue to receive a debug notice like this

- Requested subprotocol(s) not supported: MQTT
- Requested subprotocol(s) not supported: mqttv3.1.1
- Requested subprotocol(s) not supported: mqtt
- ... many other tentatives

Is it the subprotcol name that is not matching or is this feature actually
not supported?

I'm trying to have the broker to talk from a web browser to the broker and
still mqtt over ws seems the best way.
Do you have any suggestion ?

Thank you!



2016-05-31 18:50 GMT+02:00 Martyn Taylor :

> Hi Luca,
>
> You are seeing the error because you are not setting the correct version
> and protocol header in your client.  Your client should set:
>
> ProtocolID="MQTT" and ProtocolVersion=4   // 3.1.1
> or
> ProtocolID="MQlsdp" and ProtocolVersion=3 // 3,1
>
> Artemis will accept both protocol versions (which are practically
> identical) but both point to the 3.1.1 implementation.  Your mileage may
> vary with 3.1.  I suggest always using 3.1.1.
>
> line 15853 of your js should be:
>
>   var client = mqtt.connect('ws://localhost:1883', {
> protocolId: 'MQTT
> , protocolVersion: 4
>   });
>
> Instead of:
>
>   var client = mqtt.connect('ws://localhost:1883', {
> protocolId: 'MQTT' // or 'MQIsdp' in MQTT 3.1.1
> , protocolVersion: 4 // or 3 in MQTT 3.1
>   }); // you add a ws:// url here
>
> Note the protocol ID in 3.1.1 is "MQTT".
>
> I made these changes locally and it works fine for me.
>
> Thanks
> Martyn
>
> On Tue, May 31, 2016 at 2:04 PM, Luca Capra  wrote:
>
> > Hi,
> >
> > I tried to setup the mqttjs library and run it in a browser.
> > Unfortunately, it tries to connect over websocket and artemis cannot
> > recognize the subprotocol
> >
> > The source is here: http://pastebin.com/Jgeijbz9
> >
> > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker - [id:
> > 0x8958b0d5, /127.0.0.1:60138 => /127.0.0.1:1883] WebSocket version V13
> > server handshake
> > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker -
> > WebSocket version 13 server handshake key: pJTCBulMMJvyCoIpj2wEPg==,
> > response: 6vRlkIXEqz7ihckJ2TFuB6V9uhY=
> > [Thread-10 (activemq-netty-threads-2076099910)] [DEBUG]
> > io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker -
> > Requested subprotocol(s) not supported: mqttv3.1
> >
> >
> > In the latest master the issue with the client disconnecting is still
> > there, but the error message is slightly different. In 1.2 it used to
> work
> >
> > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > io.netty.util.internal.JavassistTypeParameterMatcherGenerator -
> Generated:
> >
> > io.netty.util.internal.__matchers__.io.netty.handler.
> codec.mqtt.MqttMessageMatcher
> > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > org.apache.activemq.artemis.core.protocol.mqtt - SESSION CREATED:
> > d2cd94e9-3d23-4a85-bb53-53528cd9fcb1
> > [Thread-3 (activemq-netty-threads-2076099910)] [DEBUG]
> > org.apache.activemq.artemis.core.protocol.mqtt - Bad Message
> Disconnecting
> > Client
> >
> >
> > Thank you
> >
> > Regards
> > Luca
> >
> >
> > 2016-05-27 13:25 GMT+02:00 Luca Capra :
> >
> > > Hi Martyn,
> > > I will bundle the js all in a page for testing.
> > >
> > > I think the js library will try to interact with "mqtt over websockets"
> > > from the browser.
> > > (See just one line above here,
> > > https://github.com/mqttjs/MQTT.js#contributing)
> > >
> > > Is it supposed to work in Artemis? (.. Nice feature btw!)
> > >
> > > I can either provide you the client wrapped in docker or vagrant vm if
> it
> > > works for you.
> > >
> > > Thanks
> > > Luca
> > >
> > >
> > > 2016-05-27 11:56 GMT+02:00 Martyn Taylor :
> > >
> > >> Hi Luca,
> > >>
> > >> I had a play around with the JS you supplied but didn't get it
> working.
> > >> Any chance you could browsify the test so I can run it without having
> a
> > >> NodeJS environment set up, (A bash script would do if that's
> > possible).  I
> > >> just need to see the issue in the broker.
> > >>
> > >> Thanks
> > >>
> > >> On Thu, May 26, 2016 at 10:18 AM, Luca Capra 
> > >> wrote:
> > >>
> > >> > Ok, I will double check on the client side.
> > >> >
> > >> >
> > >> > If you have the time, here the test case
> > >> >
> > >> > The nodejs client code
> > >> > https://gist.github.com/muka/b6374610618978948f39d83e5248ff7e
> > >> >
> > >> > The broker implementation (raptor-broker) is here (branch artemis)
> > >> >
> > >> > https://github.com/muka/raptor/tree/artemis
> > >> >
> > >> > To run it should just require to mvn install and run the mainClass.
> It
> > >> > requires 

RE: Problems using Qpid Proton-J with Artemis Core [solved]

2016-08-09 Thread Andy Redhead
Hi,

Martyn has just explained that proton-j is used by the artemis amqp support 
server side (and looking on maven, proton-j is listed as a dependency of 
artemis-amqp-protocol, which would explain why it came back when I just did a 
clean build without including it as an explicit dependency).

For completeness I've attached the source for the producer and consumer, along 
with the gradle build file I used to build them.

Cheers, Andy

-Original Message-
From: John D. Ament [mailto:johndam...@apache.org]
Sent: 09 August 2016 14:30
To: users@activemq.apache.org; Martyn Taylor 
Subject: Re: Problems using Qpid Proton-J with Artemis Core

Andy,

Sorry, maybe missed a step here.  What does your client look like? What are its 
maven dependencies?

FWIW, I would expect amqp to work regardless of underlying impl.  May be 
something is missing from your side, or you're using the artemis client under 
the hood?

John

On Tue, Aug 9, 2016 at 9:24 AM Andy Redhead 
wrote:

> Hi,
>
> Thanks for that, with both “artemis-amqp-protocol” and
> “artemis-proton-plug” included in the server and making sure that the
> producer and consumer were using the address “amqp://localhost:5672/ctest”
> it all works ☺
>
> Out of interest, if qpid proton is a server agnostic AMQP client, why
> does the server need the artemis-proton-plug dependency?
>
> For the doco glitch I’ve created Jira ticket:
>
> https://issues.apache.org/jira/browse/ARTEMIS-674
>
> Cheers, Andy
>
> From: Martyn Taylor [mailto:mtay...@redhat.com]
> Sent: 09 August 2016 13:40
> To: Andy Redhead 
> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>
>
> On Tue, Aug 9, 2016 at 1:01 PM, Andy Redhead
> 
> wrote:
> Hi,
>
> I've attached all the files, hopefully they will go through this time
> (I think I sent the email to users-help rather than users the first
> time by mistake and didn't re-attach the files when I tried again).
>
> Well spotted on the doc version number, though the same reference to
> proton-j is referenced in the same section of:
>
> https://activemq.apache.org/artemis/docs/1.3.0/examples.html
> Thanks for the info.  Could you open a JIRA to report the missing
> example and we'll get things updated:
> https://issues.apache.org/jira/browse/ARTEMIS
>
>
> I'm running v1.3.0 (and use that as the dependency when building the
> Artemis server).
>
> One thing I just noticed looking in the new examples documentation
> page is that on Artemis startup there are log lines for:
>
> Protocol module found: [artemis-server]. Adding protocol support for:
> CORE Protocol module found: [artemis-amqp-protocol]. Adding protocol
> support
> for: AMQP
>
> When my server starts up I only see:
>
> Protocol module found: [artemis-server]. Adding protocol support for:
> CORE This looks like you don't have the proper protocol module
> libraries on your class path.  Add the following libraries to enable AMQP:
>
> 
> org.apache.activemq
> artemis-proton-plug
> 1.3.0
> 
>
> 
> org.apache.activemq
> artemis-amqp-protocol
> 1.3.0
> 
>
> Perhaps I'm missing some config or a code dependency to get AMPQ
> support running?
>
> Currently the only Artemis dependency I'm including in the server build is:
>
> compile group: 'org.apache.activemq', name: 'artemis-server', version:
> '1.3.0'
>
> Cheers, Andy
>
> -Original Message-
> From: Martyn Taylor [mailto:mtay...@redhat.com]
> Sent: 09 August 2016 12:32
> To: users@activemq.apache.org
> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>
> Hi Andy,
>
> The attachments don't seem to have come through for me?  Could you
> please send over the broker.xml and your log out put and I will take a look.
>
> I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I
> would use the latest version of the broker and docs.
>
> Thanks
> Martyn
>
>
> On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead <
> andy.redh...@oneadvanced.com>
> wrote:
>
> > Hi,
> >
> > I'm new to Artemis and AMQP so it's quite likely I'm doing something
> > stupid...
> >
> > I'd like to be able to send messages from an AMQP client through
> > Artemis to a Java client (running in the same JVM as Artemis, using
> > an in-VM connector).
> >
> > For now, the remote client is written in Java using the Apache Qpid
> > Proton-J AMQP library. Longer term, the client will be written in C.
> >
> > The code is running on my macbook pro laptop using Oracle Java8 (no
> > native libraries installed).
> >
> > The problem I have is that when I try to use Proton-J to send (or
> > receive) messages via Artemis, no messages are sent/received and the
> > interaction between the clients and Artemis server look a bit "strange"
> (more below).
> >
> > I'd really appreciate some pointers on how to get (Java) AMQP
> > clients interacting with Artemis.
> >
> > (the Artemis documentation at: https://activemq.apache.org/
> > 

Re: Messages piling up in FailoverTranport

2016-08-09 Thread pdudits
I concluded that it is a bug and filed
https://issues.apache.org/jira/browse/AMQ-6391.



-
---
Patrik Dudits
--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Messages-piling-up-in-FailoverTranport-tp4715072p4715258.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Martyn Taylor
Apologies I hit the "reply" and not "reply list".

Posting to list for others.

Thanks.

On Tue, Aug 9, 2016 at 2:47 PM, Martyn Taylor  wrote:

>
>
> On Tue, Aug 9, 2016 at 2:24 PM, Andy Redhead  > wrote:
>
>> Hi,
>>
>> Thanks for that, with both “artemis-amqp-protocol” and
>> “artemis-proton-plug” included in the server and making sure that the
>> producer and consumer were using the address “amqp://localhost:5672/ctest”
>> it all works ☺
>>
> Good to hear.
>
>>
>> Out of interest, if qpid proton is a server agnostic AMQP client, why
>> does the server need the artemis-proton-plug dependency?
>
>
> The proton plug module is currently required as part of the Artemis AMQP
> implementation; we use Proton server side to handle decoding of packets,
> protocol state and such.  Any AMQP 1.0 compatible client should work.
>
Just to be clear.  This proton-plug is not just required to allow proton
clients to connect.

The two components together make up the AMQP protocol implementation.  The
proton plug module deals with lower level AMQP details, decoding frames,
handling the protocol state machine, then creating appropriate events which
are then captured in the AMQP protocol module.

During the processing of these events, the AMQP protocol module interacts
with the broker core API to perform the relevant tasks, store messages,
start transaction etc

>
> We'll be doing some refactoring around AMQP in the upcoming months, the
> result of this will likely be the merger of proton-plug and the amqp
> protocol module.
>
>>
>> For the doco glitch I’ve created Jira ticket:
>>
>> https://issues.apache.org/jira/browse/ARTEMIS-674
>
> Thank you.
>
>>
>>
>> Cheers, Andy
>>
>> From: Martyn Taylor [mailto:mtay...@redhat.com]
>> Sent: 09 August 2016 13:40
>> To: Andy Redhead 
>> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>>
>>
>> On Tue, Aug 9, 2016 at 1:01 PM, Andy Redhead <
>> andy.redh...@oneadvanced.com> wrote:
>> Hi,
>>
>> I've attached all the files, hopefully they will go through this time (I
>> think I sent the email to users-help rather than users the first time by
>> mistake and didn't re-attach the files when I tried again).
>>
>> Well spotted on the doc version number, though the same reference to
>> proton-j is referenced in the same section of:
>>
>> https://activemq.apache.org/artemis/docs/1.3.0/examples.html
>> Thanks for the info.  Could you open a JIRA to report the missing example
>> and we'll get things updated: https://issues.apache.org/jira
>> /browse/ARTEMIS
>>
>>
>> I'm running v1.3.0 (and use that as the dependency when building the
>> Artemis server).
>>
>> One thing I just noticed looking in the new examples documentation page
>> is that on Artemis startup there are log lines for:
>>
>> Protocol module found: [artemis-server]. Adding protocol support for: CORE
>> Protocol module found: [artemis-amqp-protocol]. Adding protocol support
>> for: AMQP
>>
>> When my server starts up I only see:
>>
>> Protocol module found: [artemis-server]. Adding protocol support for: CORE
>> This looks like you don't have the proper protocol module libraries on
>> your class path.  Add the following libraries to enable AMQP:
>>
>> 
>> org.apache.activemq
>> artemis-proton-plug
>> 1.3.0
>> 
>>
>> 
>> org.apache.activemq
>> artemis-amqp-protocol
>> 1.3.0
>> 
>>
>> Perhaps I'm missing some config or a code dependency to get AMPQ support
>> running?
>>
>> Currently the only Artemis dependency I'm including in the server build
>> is:
>>
>> compile group: 'org.apache.activemq', name: 'artemis-server', version:
>> '1.3.0'
>>
>> Cheers, Andy
>>
>> -Original Message-
>> From: Martyn Taylor [mailto:mtay...@redhat.com]
>> Sent: 09 August 2016 12:32
>> To: users@activemq.apache.org
>> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>>
>> Hi Andy,
>>
>> The attachments don't seem to have come through for me?  Could you please
>> send over the broker.xml and your log out put and I will take a look.
>>
>> I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I
>> would use the latest version of the broker and docs.
>>
>> Thanks
>> Martyn
>>
>>
>> On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead <
>> andy.redh...@oneadvanced.com>
>> wrote:
>>
>> > Hi,
>> >
>> > I'm new to Artemis and AMQP so it's quite likely I'm doing something
>> > stupid...
>> >
>> > I'd like to be able to send messages from an AMQP client through
>> > Artemis to a Java client (running in the same JVM as Artemis, using an
>> > in-VM connector).
>> >
>> > For now, the remote client is written in Java using the Apache Qpid
>> > Proton-J AMQP library. Longer term, the client will be written in C.
>> >
>> > The code is running on my macbook pro laptop using Oracle Java8 (no
>> > native libraries installed).
>> >
>> > The problem I have is that when I try to use Proton-J to send (or
>> > receive) messages via Artemis, 

Re: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread John D. Ament
Andy,

Sorry, maybe missed a step here.  What does your client look like? What are
its maven dependencies?

FWIW, I would expect amqp to work regardless of underlying impl.  May be
something is missing from your side, or you're using the artemis client
under the hood?

John

On Tue, Aug 9, 2016 at 9:24 AM Andy Redhead 
wrote:

> Hi,
>
> Thanks for that, with both “artemis-amqp-protocol” and
> “artemis-proton-plug” included in the server and making sure that the
> producer and consumer were using the address “amqp://localhost:5672/ctest”
> it all works ☺
>
> Out of interest, if qpid proton is a server agnostic AMQP client, why does
> the server need the artemis-proton-plug dependency?
>
> For the doco glitch I’ve created Jira ticket:
>
> https://issues.apache.org/jira/browse/ARTEMIS-674
>
> Cheers, Andy
>
> From: Martyn Taylor [mailto:mtay...@redhat.com]
> Sent: 09 August 2016 13:40
> To: Andy Redhead 
> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>
>
> On Tue, Aug 9, 2016 at 1:01 PM, Andy Redhead 
> wrote:
> Hi,
>
> I've attached all the files, hopefully they will go through this time (I
> think I sent the email to users-help rather than users the first time by
> mistake and didn't re-attach the files when I tried again).
>
> Well spotted on the doc version number, though the same reference to
> proton-j is referenced in the same section of:
>
> https://activemq.apache.org/artemis/docs/1.3.0/examples.html
> Thanks for the info.  Could you open a JIRA to report the missing example
> and we'll get things updated:
> https://issues.apache.org/jira/browse/ARTEMIS
>
>
> I'm running v1.3.0 (and use that as the dependency when building the
> Artemis server).
>
> One thing I just noticed looking in the new examples documentation page is
> that on Artemis startup there are log lines for:
>
> Protocol module found: [artemis-server]. Adding protocol support for: CORE
> Protocol module found: [artemis-amqp-protocol]. Adding protocol support
> for: AMQP
>
> When my server starts up I only see:
>
> Protocol module found: [artemis-server]. Adding protocol support for: CORE
> This looks like you don't have the proper protocol module libraries on
> your class path.  Add the following libraries to enable AMQP:
>
> 
> org.apache.activemq
> artemis-proton-plug
> 1.3.0
> 
>
> 
> org.apache.activemq
> artemis-amqp-protocol
> 1.3.0
> 
>
> Perhaps I'm missing some config or a code dependency to get AMPQ support
> running?
>
> Currently the only Artemis dependency I'm including in the server build is:
>
> compile group: 'org.apache.activemq', name: 'artemis-server', version:
> '1.3.0'
>
> Cheers, Andy
>
> -Original Message-
> From: Martyn Taylor [mailto:mtay...@redhat.com]
> Sent: 09 August 2016 12:32
> To: users@activemq.apache.org
> Subject: Re: Problems using Qpid Proton-J with Artemis Core
>
> Hi Andy,
>
> The attachments don't seem to have come through for me?  Could you please
> send over the broker.xml and your log out put and I will take a look.
>
> I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I
> would use the latest version of the broker and docs.
>
> Thanks
> Martyn
>
>
> On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead <
> andy.redh...@oneadvanced.com>
> wrote:
>
> > Hi,
> >
> > I'm new to Artemis and AMQP so it's quite likely I'm doing something
> > stupid...
> >
> > I'd like to be able to send messages from an AMQP client through
> > Artemis to a Java client (running in the same JVM as Artemis, using an
> > in-VM connector).
> >
> > For now, the remote client is written in Java using the Apache Qpid
> > Proton-J AMQP library. Longer term, the client will be written in C.
> >
> > The code is running on my macbook pro laptop using Oracle Java8 (no
> > native libraries installed).
> >
> > The problem I have is that when I try to use Proton-J to send (or
> > receive) messages via Artemis, no messages are sent/received and the
> > interaction between the clients and Artemis server look a bit "strange"
> (more below).
> >
> > I'd really appreciate some pointers on how to get (Java) AMQP clients
> > interacting with Artemis.
> >
> > (the Artemis documentation at: https://activemq.apache.org/
> > artemis/docs/1.0.0/examples.html talks about an example in the section
> > titled "Proton Qpid" that refers to an example called "proton-j" -
> > this doesn't seem to exist in the distribution or on GitHub, there is
> > an example called "Queue" that uses Qpid JMS but I'm not sure that's
> > relevant as I don't want to use JMS and I want to use a queue that
> > already exists in Artemis, rather than creating a new queue when the
> > producer connects)
> >
> > The rest of this email describes what I've been doing...
> >
> > The server side is a an embedded Artemis core that is started up by a
> > simple spring app running in Tomcat (spring config and source code
> > 

RE: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Andy Redhead
Hi,

Thanks for that, with both “artemis-amqp-protocol” and “artemis-proton-plug” 
included in the server and making sure that the producer and consumer were 
using the address “amqp://localhost:5672/ctest” it all works ☺

Out of interest, if qpid proton is a server agnostic AMQP client, why does the 
server need the artemis-proton-plug dependency?

For the doco glitch I’ve created Jira ticket:

https://issues.apache.org/jira/browse/ARTEMIS-674

Cheers, Andy

From: Martyn Taylor [mailto:mtay...@redhat.com]
Sent: 09 August 2016 13:40
To: Andy Redhead 
Subject: Re: Problems using Qpid Proton-J with Artemis Core


On Tue, Aug 9, 2016 at 1:01 PM, Andy Redhead  
wrote:
Hi,

I've attached all the files, hopefully they will go through this time (I think 
I sent the email to users-help rather than users the first time by mistake and 
didn't re-attach the files when I tried again).

Well spotted on the doc version number, though the same reference to proton-j 
is referenced in the same section of:

https://activemq.apache.org/artemis/docs/1.3.0/examples.html
Thanks for the info.  Could you open a JIRA to report the missing example and 
we'll get things updated: https://issues.apache.org/jira/browse/ARTEMIS


I'm running v1.3.0 (and use that as the dependency when building the Artemis 
server).

One thing I just noticed looking in the new examples documentation page is that 
on Artemis startup there are log lines for:

Protocol module found: [artemis-server]. Adding protocol support for: CORE
Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: 
AMQP

When my server starts up I only see:

Protocol module found: [artemis-server]. Adding protocol support for: CORE
This looks like you don't have the proper protocol module libraries on your 
class path.  Add the following libraries to enable AMQP:


org.apache.activemq
artemis-proton-plug
1.3.0



org.apache.activemq
artemis-amqp-protocol
1.3.0


Perhaps I'm missing some config or a code dependency to get AMPQ support 
running?

Currently the only Artemis dependency I'm including in the server build is:

compile group: 'org.apache.activemq', name: 'artemis-server', version: '1.3.0'

Cheers, Andy

-Original Message-
From: Martyn Taylor [mailto:mtay...@redhat.com]
Sent: 09 August 2016 12:32
To: users@activemq.apache.org
Subject: Re: Problems using Qpid Proton-J with Artemis Core

Hi Andy,

The attachments don't seem to have come through for me?  Could you please send 
over the broker.xml and your log out put and I will take a look.

I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I would 
use the latest version of the broker and docs.

Thanks
Martyn


On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead 
wrote:

> Hi,
>
> I'm new to Artemis and AMQP so it's quite likely I'm doing something
> stupid...
>
> I'd like to be able to send messages from an AMQP client through
> Artemis to a Java client (running in the same JVM as Artemis, using an
> in-VM connector).
>
> For now, the remote client is written in Java using the Apache Qpid
> Proton-J AMQP library. Longer term, the client will be written in C.
>
> The code is running on my macbook pro laptop using Oracle Java8 (no
> native libraries installed).
>
> The problem I have is that when I try to use Proton-J to send (or
> receive) messages via Artemis, no messages are sent/received and the
> interaction between the clients and Artemis server look a bit "strange" (more 
> below).
>
> I'd really appreciate some pointers on how to get (Java) AMQP clients
> interacting with Artemis.
>
> (the Artemis documentation at: https://activemq.apache.org/
> artemis/docs/1.0.0/examples.html talks about an example in the section
> titled "Proton Qpid" that refers to an example called "proton-j" -
> this doesn't seem to exist in the distribution or on GitHub, there is
> an example called "Queue" that uses Qpid JMS but I'm not sure that's
> relevant as I don't want to use JMS and I want to use a queue that
> already exists in Artemis, rather than creating a new queue when the
> producer connects)
>
> The rest of this email describes what I've been doing...
>
> The server side is a an embedded Artemis core that is started up by a
> simple spring app running in Tomcat (spring config and source code
> "AsyncMsgBrokerAmqArtemis.java" attached).
>
> The broker.xml file used to configure Artemis is also attached. It is
> intentionally a very minimal configuration, with no security or
> message persistence. There are acceptors configured for both the
> default Artemis port and the default AMQP port.
>
> I think this setup works because if I use a remote client using the
> core Artemis API I can send and receive messages as expected.
>
> Now to the behaviour using AMQP...
>
> Code for the producer (QpidProtonSend.java) and consumer
> (QpidProtonReceive.java) is attached, both classes are 

Re: ArrayIndexOutOfBoundsException in ActiveMQ v5.11.1

2016-08-09 Thread xabhi
Is this something I should worry about happening again? What scenarios can
cause the ArrayIndexOutOfBoundsException exception (in the first post)?

Thanks,
Abhi





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ArrayIndexOutOfBoundsException-in-ActiveMQ-v5-11-1-tp4715139p4715253.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Andy Redhead
Hi,

In an attempt to answer my own question, it seems that I was missing the 
dependency:

compile group: 'org.apache.activemq', name: 'artemis-amqp-protocol', version: 
'1.3.0'

With that included in my build, when the server starts I now see the line:

Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: 
AMQP

With that in place, the producer now seems to do the put and send straight 
after each other and exit as expected, however the consumer still doesn't 
receive the message. The server logs show:

2016-08-09T13:28:11,699 319102 [Thread-4 (activemq-netty-threads-746685035)] 
TRACE o.a.a.a.c.r.s.i.RemotingServiceImpl - Connection created 
org.apache.activemq.artemis.core.remoting.impl.netty.NettyServerConnection@3388817[local=
 /127.0.0.1:5672, remote=/127.0.0.1:55306]
2016-08-09T13:28:11,717 319120 [Thread-25 
(ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$2@19854ceb-1194181639)]
 TRACE o.a.a.a.c.t.impl.TransactionImpl - 
TransactionImpl::rollback::TransactionImpl [xid=null, id=7, xid=null, 
state=ACTIVE, createTime=1470745691717(Tue Aug 09 13:28:11 BST 2016), 
timeoutSeconds=300, nr operations = 0]@4e1d1cc8
2016-08-09T13:28:11,718 319121 [Thread-25 
(ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$2@19854ceb-1194181639)]
 TRACE o.a.a.a.c.t.impl.TransactionImpl - TransactionImpl::internalRollback 
TransactionImpl [xid=null, id=7, xid=null, state=ACTIVE, 
createTime=1470745691717(Tue Aug 09 13:28:11 BST 2016), timeoutSeconds=300, nr 
operations = 0]@4e1d1cc8
2016-08-09T13:28:11,719 319122 [Thread-4 (activemq-netty-threads-746685035)] 
TRACE o.a.a.a.c.r.s.i.RemotingServiceImpl - Connection removed -586303861 from 
server ActiveMQServerImpl::serverUUID=ff4f71ba-5e2b-11e6-8283-685b35bfdcae
java.lang.Exception: trace
at 
org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.connectionDestroyed(RemotingServiceImpl.java:492)
at 
org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor$Listener.connectionDestroyed(NettyAcceptor.java:675)
at 
org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelInactive(ActiveMQChannelHandler.java:75)
at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:208)
at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:194)
at 
io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:828)
at 
io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:625)
at 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:745)
2016-08-09T13:28:11,720 319123 [Thread-4 (activemq-netty-threads-746685035)] 
DEBUG o.a.a.a.c.r.s.i.RemotingServiceImpl - RemotingServiceImpl::removing 
connection ID -586303861


This looks like a transaction is being rolled back, I haven't knowingly asked 
for a transaction and I have no idea what I should be doing to commit a 
transaction if one is being created for me...

Cheers, Andy

-Original Message-
From: Andy Redhead
Sent: 09 August 2016 13:01
To: users@activemq.apache.org; 'mtay...@redhat.com' 
Subject: RE: Problems using Qpid Proton-J with Artemis Core

Hi,

I've attached all the files, hopefully they will go through this time (I think 
I sent the email to users-help rather than users the first time by mistake and 
didn't re-attach the files when I tried again).

Well spotted on the doc version number, though the same reference to proton-j 
is referenced in the same section of:

https://activemq.apache.org/artemis/docs/1.3.0/examples.html

I'm running v1.3.0 (and use that as the dependency when building the Artemis 
server).

One thing I just noticed looking in the new examples documentation page is that 
on Artemis startup there are log lines for:

Protocol module found: [artemis-server]. Adding protocol support for: CORE
Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: 
AMQP

When my server starts up I only see:

Protocol module found: [artemis-server]. Adding protocol support for: CORE

Perhaps I'm missing some config or a code dependency to get AMPQ support 
running?

Currently the only Artemis dependency I'm including in the server build is:

compile group: 'org.apache.activemq', name: 'artemis-server', version: '1.3.0'

Cheers, Andy

-Original Message-
From: Martyn Taylor [mailto:mtay...@redhat.com]
Sent: 09 August 2016 12:32
To: users@activemq.apache.org
Subject: Re: Problems using Qpid Proton-J with Artemis Core

Hi Andy,

The attachments don't seem to have come through for me?  Could you please send 
over the broker.xml and your log out put and I 

RE: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Andy Redhead
Hi,

I've attached all the files, hopefully they will go through this time (I think 
I sent the email to users-help rather than users the first time by mistake and 
didn't re-attach the files when I tried again).

Well spotted on the doc version number, though the same reference to proton-j 
is referenced in the same section of:

https://activemq.apache.org/artemis/docs/1.3.0/examples.html

I'm running v1.3.0 (and use that as the dependency when building the Artemis 
server).

One thing I just noticed looking in the new examples documentation page is that 
on Artemis startup there are log lines for:

Protocol module found: [artemis-server]. Adding protocol support for: CORE
Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: 
AMQP

When my server starts up I only see:

Protocol module found: [artemis-server]. Adding protocol support for: CORE

Perhaps I'm missing some config or a code dependency to get AMPQ support 
running?

Currently the only Artemis dependency I'm including in the server build is:

compile group: 'org.apache.activemq', name: 'artemis-server', version: '1.3.0'

Cheers, Andy

-Original Message-
From: Martyn Taylor [mailto:mtay...@redhat.com]
Sent: 09 August 2016 12:32
To: users@activemq.apache.org
Subject: Re: Problems using Qpid Proton-J with Artemis Core

Hi Andy,

The attachments don't seem to have come through for me?  Could you please send 
over the broker.xml and your log out put and I will take a look.

I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I would 
use the latest version of the broker and docs.

Thanks
Martyn


On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead 
wrote:

> Hi,
>
> I'm new to Artemis and AMQP so it's quite likely I'm doing something
> stupid...
>
> I'd like to be able to send messages from an AMQP client through
> Artemis to a Java client (running in the same JVM as Artemis, using an
> in-VM connector).
>
> For now, the remote client is written in Java using the Apache Qpid
> Proton-J AMQP library. Longer term, the client will be written in C.
>
> The code is running on my macbook pro laptop using Oracle Java8 (no
> native libraries installed).
>
> The problem I have is that when I try to use Proton-J to send (or
> receive) messages via Artemis, no messages are sent/received and the
> interaction between the clients and Artemis server look a bit "strange" (more 
> below).
>
> I'd really appreciate some pointers on how to get (Java) AMQP clients
> interacting with Artemis.
>
> (the Artemis documentation at: https://activemq.apache.org/
> artemis/docs/1.0.0/examples.html talks about an example in the section
> titled "Proton Qpid" that refers to an example called "proton-j" -
> this doesn't seem to exist in the distribution or on GitHub, there is
> an example called "Queue" that uses Qpid JMS but I'm not sure that's
> relevant as I don't want to use JMS and I want to use a queue that
> already exists in Artemis, rather than creating a new queue when the
> producer connects)
>
> The rest of this email describes what I've been doing...
>
> The server side is a an embedded Artemis core that is started up by a
> simple spring app running in Tomcat (spring config and source code
> "AsyncMsgBrokerAmqArtemis.java" attached).
>
> The broker.xml file used to configure Artemis is also attached. It is
> intentionally a very minimal configuration, with no security or
> message persistence. There are acceptors configured for both the
> default Artemis port and the default AMQP port.
>
> I think this setup works because if I use a remote client using the
> core Artemis API I can send and receive messages as expected.
>
> Now to the behaviour using AMQP...
>
> Code for the producer (QpidProtonSend.java) and consumer
> (QpidProtonReceive.java) is attached, both classes are pretty much the
> qpid example code available at:
>
> https://github.com/apache/qpid-proton/blob/master/
> examples/java/messenger/src/main/java/org/apache/qpid/proton/example
>
> There is a queue called "ctest" in broker.xml, I'm intending for the
> producer to write messages onto that queue and the consumer to read
> messages from that queue.
>
>
> Producer)
>
> I start the producer from a command line using a command such as:
>
> java -classpath './build/output/lib/*:./build/libs/*'
> com.adv365.solutions.asyncmsg.amqpclient.QpidProtonSend -a
> amqp://localhost:5672/ hello
>
> When the client is first started the producer writes the following to
> stdout:
>
> put message: Message{properties=Properties{messageId=null,
> userId=null, to='amqp://localhost:5672/', subject='null',
> replyTo='null', correlationId=null, contentType=null,
> contentEncoding=null, absoluteExpiryTime=null, creationTime=null,
> groupId='null', groupSequence=null,
> replyToGroupId='null'}body=AmqpValue{hello}}
>
> Then things seem to hang for about a minute until finally (probably
> linked to a timeout at the server end, see server trace level logs
> 

Re: Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Martyn Taylor
Hi Andy,

The attachments don't seem to have come through for me?  Could you please
send over the broker.xml and your log out put and I will take a look.

I noticed you referred to the docs from 1.0.0, we're up to 1.3.0 now I
would use the latest version of the broker and docs.

Thanks
Martyn


On Tue, Aug 9, 2016 at 11:36 AM, Andy Redhead 
wrote:

> Hi,
>
> I'm new to Artemis and AMQP so it's quite likely I'm doing something
> stupid...
>
> I'd like to be able to send messages from an AMQP client through Artemis
> to a Java client (running in the same JVM as Artemis, using an in-VM
> connector).
>
> For now, the remote client is written in Java using the Apache Qpid
> Proton-J AMQP library. Longer term, the client will be written in C.
>
> The code is running on my macbook pro laptop using Oracle Java8 (no native
> libraries installed).
>
> The problem I have is that when I try to use Proton-J to send (or receive)
> messages via Artemis, no messages are sent/received and the interaction
> between the clients and Artemis server look a bit "strange" (more below).
>
> I'd really appreciate some pointers on how to get (Java) AMQP clients
> interacting with Artemis.
>
> (the Artemis documentation at: https://activemq.apache.org/
> artemis/docs/1.0.0/examples.html talks about an example in the section
> titled "Proton Qpid" that refers to an example called "proton-j" - this
> doesn't seem to exist in the distribution or on GitHub, there is an example
> called "Queue" that uses Qpid JMS but I'm not sure that's relevant as I
> don't want to use JMS and I want to use a queue that already exists in
> Artemis, rather than creating a new queue when the producer connects)
>
> The rest of this email describes what I've been doing...
>
> The server side is a an embedded Artemis core that is started up by a
> simple spring app running in Tomcat (spring config and source code
> "AsyncMsgBrokerAmqArtemis.java" attached).
>
> The broker.xml file used to configure Artemis is also attached. It is
> intentionally a very minimal configuration, with no security or message
> persistence. There are acceptors configured for both the default Artemis
> port and the default AMQP port.
>
> I think this setup works because if I use a remote client using the core
> Artemis API I can send and receive messages as expected.
>
> Now to the behaviour using AMQP...
>
> Code for the producer (QpidProtonSend.java) and consumer
> (QpidProtonReceive.java) is attached, both classes are pretty much the qpid
> example code available at:
>
> https://github.com/apache/qpid-proton/blob/master/
> examples/java/messenger/src/main/java/org/apache/qpid/proton/example
>
> There is a queue called "ctest" in broker.xml, I'm intending for the
> producer to write messages onto that queue and the consumer to read
> messages from that queue.
>
>
> Producer)
>
> I start the producer from a command line using a command such as:
>
> java -classpath './build/output/lib/*:./build/libs/*'
> com.adv365.solutions.asyncmsg.amqpclient.QpidProtonSend -a
> amqp://localhost:5672/ hello
>
> When the client is first started the producer writes the following to
> stdout:
>
> put message: Message{properties=Properties{messageId=null, userId=null,
> to='amqp://localhost:5672/', subject='null', replyTo='null',
> correlationId=null, contentType=null, contentEncoding=null,
> absoluteExpiryTime=null, creationTime=null, groupId='null',
> groupSequence=null, replyToGroupId='null'}body=AmqpValue{hello}}
>
> Then things seem to hang for about a minute until finally (probably linked
> to a timeout at the server end, see server trace level logs
> "server-send-log.txt") the producer writes the following to stdout:
>
> sent message: Message{properties=Properties{messageId=null, userId=null,
> to='amqp://localhost:5672/', subject='null', replyTo='null',
> correlationId=null, contentType=null, contentEncoding=null,
> absoluteExpiryTime=null, creationTime=null, groupId='null',
> groupSequence=null, replyToGroupId='null'}body=AmqpValue{hello}}
>
> In the server logs there is a line for when the producer connects:
>
> 2016-08-09T10:33:29,985 4900511 [Thread-11 
> (activemq-netty-threads-1155186594)]
> TRACE o.a.a.a.c.r.s.i.RemotingServiceImpl - Connection created
> org.apache.activemq.artemis.core.remoting.impl.netty.
> NettyServerConnection@4b2fd1ac[local= /127.0.0.1:5672, remote=/
> 127.0.0.1:52719]
>
> And around a minute later, visibly around the same time as the producer
> claims to have sent a message there is the line:
>
> 2016-08-09T10:34:31,353 4961879 [activemq-failure-check-thread] DEBUG
> o.a.a.a.c.r.s.i.RemotingServiceImpl - RemotingServiceImpl::removing
> connection ID -1728467180
>
> The following log lines are available in full in server-send-log.txt, I
> think the key point is:
>
>"Did not receive data from /127.0.0.1:52719"
>
> My two observations about this are:
>  - why did the producer hang until something timed out on the server,
> rather 

Problems using Qpid Proton-J with Artemis Core

2016-08-09 Thread Andy Redhead
Hi,

I'm new to Artemis and AMQP so it's quite likely I'm doing something stupid...

I'd like to be able to send messages from an AMQP client through Artemis to a 
Java client (running in the same JVM as Artemis, using an in-VM connector).

For now, the remote client is written in Java using the Apache Qpid Proton-J 
AMQP library. Longer term, the client will be written in C.

The code is running on my macbook pro laptop using Oracle Java8 (no native 
libraries installed).

The problem I have is that when I try to use Proton-J to send (or receive) 
messages via Artemis, no messages are sent/received and the interaction between 
the clients and Artemis server look a bit "strange" (more below).

I'd really appreciate some pointers on how to get (Java) AMQP clients 
interacting with Artemis.

(the Artemis documentation at: 
https://activemq.apache.org/artemis/docs/1.0.0/examples.html talks about an 
example in the section titled "Proton Qpid" that refers to an example called 
"proton-j" - this doesn't seem to exist in the distribution or on GitHub, there 
is an example called "Queue" that uses Qpid JMS but I'm not sure that's 
relevant as I don't want to use JMS and I want to use a queue that already 
exists in Artemis, rather than creating a new queue when the producer connects)

The rest of this email describes what I've been doing...

The server side is a an embedded Artemis core that is started up by a simple 
spring app running in Tomcat (spring config and source code 
"AsyncMsgBrokerAmqArtemis.java" attached).

The broker.xml file used to configure Artemis is also attached. It is 
intentionally a very minimal configuration, with no security or message 
persistence. There are acceptors configured for both the default Artemis port 
and the default AMQP port.

I think this setup works because if I use a remote client using the core 
Artemis API I can send and receive messages as expected.

Now to the behaviour using AMQP...

Code for the producer (QpidProtonSend.java) and consumer 
(QpidProtonReceive.java) is attached, both classes are pretty much the qpid 
example code available at:

https://github.com/apache/qpid-proton/blob/master/examples/java/messenger/src/main/java/org/apache/qpid/proton/example

There is a queue called "ctest" in broker.xml, I'm intending for the producer 
to write messages onto that queue and the consumer to read messages from that 
queue.


Producer)

I start the producer from a command line using a command such as:

java -classpath './build/output/lib/*:./build/libs/*' 
com.adv365.solutions.asyncmsg.amqpclient.QpidProtonSend -a 
amqp://localhost:5672/ hello

When the client is first started the producer writes the following to stdout:

put message: Message{properties=Properties{messageId=null, userId=null, 
to='amqp://localhost:5672/', subject='null', replyTo='null', 
correlationId=null, contentType=null, contentEncoding=null, 
absoluteExpiryTime=null, creationTime=null, groupId='null', groupSequence=null, 
replyToGroupId='null'}body=AmqpValue{hello}}

Then things seem to hang for about a minute until finally (probably linked to a 
timeout at the server end, see server trace level logs "server-send-log.txt") 
the producer writes the following to stdout:

sent message: Message{properties=Properties{messageId=null, userId=null, 
to='amqp://localhost:5672/', subject='null', replyTo='null', 
correlationId=null, contentType=null, contentEncoding=null, 
absoluteExpiryTime=null, creationTime=null, groupId='null', groupSequence=null, 
replyToGroupId='null'}body=AmqpValue{hello}}

In the server logs there is a line for when the producer connects:

2016-08-09T10:33:29,985 4900511 [Thread-11 (activemq-netty-threads-1155186594)] 
TRACE o.a.a.a.c.r.s.i.RemotingServiceImpl - Connection created 
org.apache.activemq.artemis.core.remoting.impl.netty.NettyServerConnection@4b2fd1ac[local=
 /127.0.0.1:5672, remote=/127.0.0.1:52719]

And around a minute later, visibly around the same time as the producer claims 
to have sent a message there is the line:

2016-08-09T10:34:31,353 4961879 [activemq-failure-check-thread] DEBUG 
o.a.a.a.c.r.s.i.RemotingServiceImpl - RemotingServiceImpl::removing connection 
ID -1728467180

The following log lines are available in full in server-send-log.txt, I think 
the key point is:

   "Did not receive data from /127.0.0.1:52719"

My two observations about this are:
 - why did the producer hang until something timed out on the server, rather 
than simply sending a message and disconnecting immediately?
 - why does the producer think that a message has been sent ok while the server 
doesn't think it received any data?


Consumer)

With a freshly re-started tomcat, I start the consumer in a new command prompt 
using:

java -classpath './build/output/lib/*:./build/libs/*' 
com.adv365.solutions.asyncmsg.amqpclient.QpidProtonReceive -a 
amqp://localhost:5672/ctest

The consumer writes to stdout:

Qpid receiver subscribed to address: amqp://localhost:5672/ctest

The