Re: singleton with autocloseable

2021-06-16 Thread Matthew Broadhead
ah ok i have found the readme at 
https://github.com/apache/tomee-chatterbox/blob/master/chatterbox-nats/README.adoc


On 16/06/2021 20:00, Matthew Broadhead wrote:

Hi Jon,

Thanks for all the effort you have put in.  Looking at the latest 
commit I can't see any change to the readme file or any configuration 
in the war project.  Is it possible I am looking at the wrong branch?


That would be great if it is released and I can get it through maven

On 16/06/2021 16:43, Jonathan Gallimore wrote:
Pushed. I've made client Id and cluster id configuration options and 
added

a README. If it working for you, I'd suggest we cut a 0.3 release unless
there are any objections.

Jon

On Wed, Jun 16, 2021 at 12:16 PM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:

Sorry, tied up with a couple of things here. Literally just opened 
the IDE

to finish this off. :)

Jon

On Wed, Jun 16, 2021 at 9:46 AM Matthew Broadhead
 wrote:


hi Jon,

Is there anything else you need from my end?  It feels like it is 
nearly

finished.  Could it pass the parameters in a similar way to how it is
done in the chatterbox-imap?  sending them in from the tomee.xml?


On 10/06/2021 19:07, Jonathan Gallimore wrote:

Thank you! That worked. I have pushed an update to my code, and I've

been

able to send a message to NATS from a REST endpoint, and receive a

message

from NATS via an MDB.

I still need to extract the cluster ID and client ID into 
properties for

the resource adapter, and of course, try and write up how this works.

Code
is here: https://github.com/jgallimore/tomee-chatterbox/tree/nats, 
but

I'll

merge it in once I have done these couple of changes.

One other thing on my mind is that I'd like to try and find some 
way to

make all this easier. If you've used JMS, you've used JCA, possibly

without
realizing it, but the spec still feels very hard to get into - I 
wonder

if
there is anything we can propose in that regard to try and make 
creating

simple connectors a bit easier.

Jon

On Wed, Jun 9, 2021 at 4:31 PM Matthew Broadhead
 wrote:


hi, it was my fault putting a confusing value in the docker compose
file.  it should work like this

StreamingConnectionFactory cf = new
    StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
.clusterId("yourclientid").clientId("anything").build());

but you could change the docker-compose.yml to have a -cid of
yourclusterid and then do this

StreamingConnectionFactory cf = new
    StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
.clusterId("yourclusterid").clientId("yourclientid").build());

On 09/06/2021 17:15, Jonathan Gallimore wrote:

Thanks. If I can get that test going, I can probably get the rest

working.

I suspect there are some other bugs in there.

Jon

On Wed, Jun 9, 2021 at 4:04 PM Matthew Broadhead
 wrote:


Thanks I will have a look now

On 09/06/2021 15:19, Jonathan Gallimore wrote:

Ok, I'm stuck. If I boot up a NATS server with your

docker-compose.yml

file, and run the following test:

    @Test
    public void testShouldConnect() throws Exception {
    StreamingConnectionFactory cf = new
    StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")


.clusterId("cluster-id").clientId("yourclientid").build());

    final StreamingConnection connection =

cf.createConnection();

Assert.assertNotNull(connection);

    connection.close();
    }

It fails with a timeout.

I monitored the connection with wireshark, and see the following

< = from server to client

= from client to server

<{"server_id":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","server_name":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","version":"2.1.4","proto":1,"git_commit":"fb009af","go":"go1.13.7","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":10} 


CONNECT
{"lang":"java","version":"2.6.5","name":"yourclientid","protocol":1,"verbose":false,"pedantic":false,"tls_required":false,"echo":true} 


PING


SUB _STAN.acks.LP4bdY88abuVJ19Qo5HVuk 1
SUB _INBOX.LP4bdY88abuVJ19Qo5HVn8 2
SUB _INBOX.LP4bdY88abuVJ19Qo5HVqw 3
SUB _INBOX.F0vVy1N0sQM3xseeEWMIAL.* 4
PUB _STAN.discover.cluster-id

_INBOX.F0vVy1N0sQM3xseeEWMIAL.F0vVy1N0sQM3xseeEWMISH 75
.yourclientid.._INBOX.LP4bdY88abuVJ19Qo5HVn8..".LP4bdY88abuVJ19Qo5HVjK(.0. 



PONG
UNSUB 1
UNSUB 2
UNSUB 3

So there does appear to be some communication between my test and

the

NATS

server - I have no idea why it times out.

My code is here if you want to have a go:
https://github.com/jgallimore/tomee-chatterbox/tree/nats

Jon

On Wed, Jun 9, 2021 at 11:56 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


Nervermind, I figured out my mistake. I'll post back when I have

something

going.

Jon

On Wed, Jun 9, 2021 at 11:44 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


I think I have something wired up, but when executing this:

  

Re: singleton with autocloseable

2021-06-16 Thread Matthew Broadhead

Hi Jon,

Thanks for all the effort you have put in.  Looking at the latest commit 
I can't see any change to the readme file or any configuration in the 
war project.  Is it possible I am looking at the wrong branch?


That would be great if it is released and I can get it through maven

On 16/06/2021 16:43, Jonathan Gallimore wrote:

Pushed. I've made client Id and cluster id configuration options and added
a README. If it working for you, I'd suggest we cut a 0.3 release unless
there are any objections.

Jon

On Wed, Jun 16, 2021 at 12:16 PM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


Sorry, tied up with a couple of things here. Literally just opened the IDE
to finish this off. :)

Jon

On Wed, Jun 16, 2021 at 9:46 AM Matthew Broadhead
 wrote:


hi Jon,

Is there anything else you need from my end?  It feels like it is nearly
finished.  Could it pass the parameters in a similar way to how it is
done in the chatterbox-imap?  sending them in from the tomee.xml?


On 10/06/2021 19:07, Jonathan Gallimore wrote:

Thank you! That worked. I have pushed an update to my code, and I've

been

able to send a message to NATS from a REST endpoint, and receive a

message

from NATS via an MDB.

I still need to extract the cluster ID and client ID into properties for
the resource adapter, and of course, try and write up how this works.

Code

is here: https://github.com/jgallimore/tomee-chatterbox/tree/nats, but

I'll

merge it in once I have done these couple of changes.

One other thing on my mind is that I'd like to try and find some way to
make all this easier. If you've used JMS, you've used JCA, possibly

without

realizing it, but the spec still feels very hard to get into - I wonder

if

there is anything we can propose in that regard to try and make creating
simple connectors a bit easier.

Jon

On Wed, Jun 9, 2021 at 4:31 PM Matthew Broadhead
 wrote:


hi, it was my fault putting a confusing value in the docker compose
file.  it should work like this

StreamingConnectionFactory cf = new
StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
.clusterId("yourclientid").clientId("anything").build());

but you could change the docker-compose.yml to have a -cid of
yourclusterid and then do this

StreamingConnectionFactory cf = new
StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
.clusterId("yourclusterid").clientId("yourclientid").build());

On 09/06/2021 17:15, Jonathan Gallimore wrote:

Thanks. If I can get that test going, I can probably get the rest

working.

I suspect there are some other bugs in there.

Jon

On Wed, Jun 9, 2021 at 4:04 PM Matthew Broadhead
 wrote:


Thanks I will have a look now

On 09/06/2021 15:19, Jonathan Gallimore wrote:

Ok, I'm stuck. If I boot up a NATS server with your

docker-compose.yml

file, and run the following test:

@Test
public void testShouldConnect() throws Exception {
StreamingConnectionFactory cf = new
StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")


.clusterId("cluster-id").clientId("yourclientid").build());

final StreamingConnection connection =

cf.createConnection();

Assert.assertNotNull(connection);

connection.close();
}

It fails with a timeout.

I monitored the connection with wireshark, and see the following

< = from server to client

= from client to server


<{"server_id":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","server_name":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","version":"2.1.4","proto":1,"git_commit":"fb009af","go":"go1.13.7","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":10}

CONNECT

{"lang":"java","version":"2.6.5","name":"yourclientid","protocol":1,"verbose":false,"pedantic":false,"tls_required":false,"echo":true}

PING


SUB _STAN.acks.LP4bdY88abuVJ19Qo5HVuk 1
SUB _INBOX.LP4bdY88abuVJ19Qo5HVn8 2
SUB _INBOX.LP4bdY88abuVJ19Qo5HVqw 3
SUB _INBOX.F0vVy1N0sQM3xseeEWMIAL.* 4
PUB _STAN.discover.cluster-id

_INBOX.F0vVy1N0sQM3xseeEWMIAL.F0vVy1N0sQM3xseeEWMISH 75

.yourclientid.._INBOX.LP4bdY88abuVJ19Qo5HVn8..".LP4bdY88abuVJ19Qo5HVjK(.0.


PONG
UNSUB 1
UNSUB 2
UNSUB 3

So there does appear to be some communication between my test and

the

NATS

server - I have no idea why it times out.

My code is here if you want to have a go:
https://github.com/jgallimore/tomee-chatterbox/tree/nats

Jon

On Wed, Jun 9, 2021 at 11:56 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


Nervermind, I figured out my mistake. I'll post back when I have

something

going.

Jon

On Wed, Jun 9, 2021 at 11:44 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


I think I have something wired up, but when executing this:

cf = new
StreamingConnectionFactory(new
Options.Builder().natsUrl(baseAddress)


Re: singleton with autocloseable

2021-06-16 Thread Jonathan Gallimore
Pushed. I've made client Id and cluster id configuration options and added
a README. If it working for you, I'd suggest we cut a 0.3 release unless
there are any objections.

Jon

On Wed, Jun 16, 2021 at 12:16 PM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:

> Sorry, tied up with a couple of things here. Literally just opened the IDE
> to finish this off. :)
>
> Jon
>
> On Wed, Jun 16, 2021 at 9:46 AM Matthew Broadhead
>  wrote:
>
>> hi Jon,
>>
>> Is there anything else you need from my end?  It feels like it is nearly
>> finished.  Could it pass the parameters in a similar way to how it is
>> done in the chatterbox-imap?  sending them in from the tomee.xml?
>>
>>
>> On 10/06/2021 19:07, Jonathan Gallimore wrote:
>> > Thank you! That worked. I have pushed an update to my code, and I've
>> been
>> > able to send a message to NATS from a REST endpoint, and receive a
>> message
>> > from NATS via an MDB.
>> >
>> > I still need to extract the cluster ID and client ID into properties for
>> > the resource adapter, and of course, try and write up how this works.
>> Code
>> > is here: https://github.com/jgallimore/tomee-chatterbox/tree/nats, but
>> I'll
>> > merge it in once I have done these couple of changes.
>> >
>> > One other thing on my mind is that I'd like to try and find some way to
>> > make all this easier. If you've used JMS, you've used JCA, possibly
>> without
>> > realizing it, but the spec still feels very hard to get into - I wonder
>> if
>> > there is anything we can propose in that regard to try and make creating
>> > simple connectors a bit easier.
>> >
>> > Jon
>> >
>> > On Wed, Jun 9, 2021 at 4:31 PM Matthew Broadhead
>> >  wrote:
>> >
>> >> hi, it was my fault putting a confusing value in the docker compose
>> >> file.  it should work like this
>> >>
>> >> StreamingConnectionFactory cf = new
>> >>StreamingConnectionFactory(new
>> >> Options.Builder().natsUrl("nats://localhost:4222")
>> >>.clusterId("yourclientid").clientId("anything").build());
>> >>
>> >> but you could change the docker-compose.yml to have a -cid of
>> >> yourclusterid and then do this
>> >>
>> >> StreamingConnectionFactory cf = new
>> >>StreamingConnectionFactory(new
>> >> Options.Builder().natsUrl("nats://localhost:4222")
>> >>.clusterId("yourclusterid").clientId("yourclientid").build());
>> >>
>> >> On 09/06/2021 17:15, Jonathan Gallimore wrote:
>> >>> Thanks. If I can get that test going, I can probably get the rest
>> >> working.
>> >>> I suspect there are some other bugs in there.
>> >>>
>> >>> Jon
>> >>>
>> >>> On Wed, Jun 9, 2021 at 4:04 PM Matthew Broadhead
>> >>>  wrote:
>> >>>
>>  Thanks I will have a look now
>> 
>>  On 09/06/2021 15:19, Jonathan Gallimore wrote:
>> > Ok, I'm stuck. If I boot up a NATS server with your
>> docker-compose.yml
>> > file, and run the following test:
>> >
>> >@Test
>> >public void testShouldConnect() throws Exception {
>> >StreamingConnectionFactory cf = new
>> >StreamingConnectionFactory(new
>> > Options.Builder().natsUrl("nats://localhost:4222")
>> >
>>  .clusterId("cluster-id").clientId("yourclientid").build());
>> >final StreamingConnection connection =
>> cf.createConnection();
>> >Assert.assertNotNull(connection);
>> >
>> >connection.close();
>> >}
>> >
>> > It fails with a timeout.
>> >
>> > I monitored the connection with wireshark, and see the following
>> >
>> > < = from server to client
>> >> = from client to server
>> > > >
>> >>
>> <{"server_id":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","server_name":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","version":"2.1.4","proto":1,"git_commit":"fb009af","go":"go1.13.7","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":10}
>> >> CONNECT
>> >>
>> {"lang":"java","version":"2.6.5","name":"yourclientid","protocol":1,"verbose":false,"pedantic":false,"tls_required":false,"echo":true}
>> >> PING
>> > > >> SUB _STAN.acks.LP4bdY88abuVJ19Qo5HVuk 1
>> >> SUB _INBOX.LP4bdY88abuVJ19Qo5HVn8 2
>> >> SUB _INBOX.LP4bdY88abuVJ19Qo5HVqw 3
>> >> SUB _INBOX.F0vVy1N0sQM3xseeEWMIAL.* 4
>> >> PUB _STAN.discover.cluster-id
>> > _INBOX.F0vVy1N0sQM3xseeEWMIAL.F0vVy1N0sQM3xseeEWMISH 75
>> >>
>> .yourclientid.._INBOX.LP4bdY88abuVJ19Qo5HVn8..".LP4bdY88abuVJ19Qo5HVjK(.0.
>> > > >> PONG
>> >> UNSUB 1
>> >> UNSUB 2
>> >> UNSUB 3
>> > So there does appear to be some communication between my test and
>> the
>>  NATS
>> > server - I have no idea why it times out.
>> >
>> > My code is here if you want to have a go:
>> > https://github.com/jgallimore/tomee-chatterbox/tree/nats
>> >
>> > Jon
>> >
>> > On Wed, Jun 9, 2021 at 11:56 AM Jonathan Gallimore <
>> > jonathan.gallim...@gmail.com> wrote:
>> 

Re: singleton with autocloseable

2021-06-16 Thread Jonathan Gallimore
Sorry, tied up with a couple of things here. Literally just opened the IDE
to finish this off. :)

Jon

On Wed, Jun 16, 2021 at 9:46 AM Matthew Broadhead
 wrote:

> hi Jon,
>
> Is there anything else you need from my end?  It feels like it is nearly
> finished.  Could it pass the parameters in a similar way to how it is
> done in the chatterbox-imap?  sending them in from the tomee.xml?
>
>
> On 10/06/2021 19:07, Jonathan Gallimore wrote:
> > Thank you! That worked. I have pushed an update to my code, and I've been
> > able to send a message to NATS from a REST endpoint, and receive a
> message
> > from NATS via an MDB.
> >
> > I still need to extract the cluster ID and client ID into properties for
> > the resource adapter, and of course, try and write up how this works.
> Code
> > is here: https://github.com/jgallimore/tomee-chatterbox/tree/nats, but
> I'll
> > merge it in once I have done these couple of changes.
> >
> > One other thing on my mind is that I'd like to try and find some way to
> > make all this easier. If you've used JMS, you've used JCA, possibly
> without
> > realizing it, but the spec still feels very hard to get into - I wonder
> if
> > there is anything we can propose in that regard to try and make creating
> > simple connectors a bit easier.
> >
> > Jon
> >
> > On Wed, Jun 9, 2021 at 4:31 PM Matthew Broadhead
> >  wrote:
> >
> >> hi, it was my fault putting a confusing value in the docker compose
> >> file.  it should work like this
> >>
> >> StreamingConnectionFactory cf = new
> >>StreamingConnectionFactory(new
> >> Options.Builder().natsUrl("nats://localhost:4222")
> >>.clusterId("yourclientid").clientId("anything").build());
> >>
> >> but you could change the docker-compose.yml to have a -cid of
> >> yourclusterid and then do this
> >>
> >> StreamingConnectionFactory cf = new
> >>StreamingConnectionFactory(new
> >> Options.Builder().natsUrl("nats://localhost:4222")
> >>.clusterId("yourclusterid").clientId("yourclientid").build());
> >>
> >> On 09/06/2021 17:15, Jonathan Gallimore wrote:
> >>> Thanks. If I can get that test going, I can probably get the rest
> >> working.
> >>> I suspect there are some other bugs in there.
> >>>
> >>> Jon
> >>>
> >>> On Wed, Jun 9, 2021 at 4:04 PM Matthew Broadhead
> >>>  wrote:
> >>>
>  Thanks I will have a look now
> 
>  On 09/06/2021 15:19, Jonathan Gallimore wrote:
> > Ok, I'm stuck. If I boot up a NATS server with your
> docker-compose.yml
> > file, and run the following test:
> >
> >@Test
> >public void testShouldConnect() throws Exception {
> >StreamingConnectionFactory cf = new
> >StreamingConnectionFactory(new
> > Options.Builder().natsUrl("nats://localhost:4222")
> >
>  .clusterId("cluster-id").clientId("yourclientid").build());
> >final StreamingConnection connection =
> cf.createConnection();
> >Assert.assertNotNull(connection);
> >
> >connection.close();
> >}
> >
> > It fails with a timeout.
> >
> > I monitored the connection with wireshark, and see the following
> >
> > < = from server to client
> >> = from client to server
> >  >
> >>
> <{"server_id":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","server_name":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","version":"2.1.4","proto":1,"git_commit":"fb009af","go":"go1.13.7","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":10}
> >> CONNECT
> >>
> {"lang":"java","version":"2.6.5","name":"yourclientid","protocol":1,"verbose":false,"pedantic":false,"tls_required":false,"echo":true}
> >> PING
> >  >> SUB _STAN.acks.LP4bdY88abuVJ19Qo5HVuk 1
> >> SUB _INBOX.LP4bdY88abuVJ19Qo5HVn8 2
> >> SUB _INBOX.LP4bdY88abuVJ19Qo5HVqw 3
> >> SUB _INBOX.F0vVy1N0sQM3xseeEWMIAL.* 4
> >> PUB _STAN.discover.cluster-id
> > _INBOX.F0vVy1N0sQM3xseeEWMIAL.F0vVy1N0sQM3xseeEWMISH 75
> >>
> .yourclientid.._INBOX.LP4bdY88abuVJ19Qo5HVn8..".LP4bdY88abuVJ19Qo5HVjK(.0.
> >  >> PONG
> >> UNSUB 1
> >> UNSUB 2
> >> UNSUB 3
> > So there does appear to be some communication between my test and the
>  NATS
> > server - I have no idea why it times out.
> >
> > My code is here if you want to have a go:
> > https://github.com/jgallimore/tomee-chatterbox/tree/nats
> >
> > Jon
> >
> > On Wed, Jun 9, 2021 at 11:56 AM Jonathan Gallimore <
> > jonathan.gallim...@gmail.com> wrote:
> >
> >> Nervermind, I figured out my mistake. I'll post back when I have
>  something
> >> going.
> >>
> >> Jon
> >>
> >> On Wed, Jun 9, 2021 at 11:44 AM Jonathan Gallimore <
> >> jonathan.gallim...@gmail.com> wrote:
> >>
> >>> I think I have something wired up, but when executing this:
> >>>
> >>>cf = new
> >>>

Re: singleton with autocloseable

2021-06-16 Thread Matthew Broadhead

hi Jon,

Is there anything else you need from my end?  It feels like it is nearly 
finished.  Could it pass the parameters in a similar way to how it is 
done in the chatterbox-imap?  sending them in from the tomee.xml?



On 10/06/2021 19:07, Jonathan Gallimore wrote:

Thank you! That worked. I have pushed an update to my code, and I've been
able to send a message to NATS from a REST endpoint, and receive a message
from NATS via an MDB.

I still need to extract the cluster ID and client ID into properties for
the resource adapter, and of course, try and write up how this works. Code
is here: https://github.com/jgallimore/tomee-chatterbox/tree/nats, but I'll
merge it in once I have done these couple of changes.

One other thing on my mind is that I'd like to try and find some way to
make all this easier. If you've used JMS, you've used JCA, possibly without
realizing it, but the spec still feels very hard to get into - I wonder if
there is anything we can propose in that regard to try and make creating
simple connectors a bit easier.

Jon

On Wed, Jun 9, 2021 at 4:31 PM Matthew Broadhead
 wrote:


hi, it was my fault putting a confusing value in the docker compose
file.  it should work like this

StreamingConnectionFactory cf = new
   StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
   .clusterId("yourclientid").clientId("anything").build());

but you could change the docker-compose.yml to have a -cid of
yourclusterid and then do this

StreamingConnectionFactory cf = new
   StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")
   .clusterId("yourclusterid").clientId("yourclientid").build());

On 09/06/2021 17:15, Jonathan Gallimore wrote:

Thanks. If I can get that test going, I can probably get the rest

working.

I suspect there are some other bugs in there.

Jon

On Wed, Jun 9, 2021 at 4:04 PM Matthew Broadhead
 wrote:


Thanks I will have a look now

On 09/06/2021 15:19, Jonathan Gallimore wrote:

Ok, I'm stuck. If I boot up a NATS server with your docker-compose.yml
file, and run the following test:

   @Test
   public void testShouldConnect() throws Exception {
   StreamingConnectionFactory cf = new
   StreamingConnectionFactory(new
Options.Builder().natsUrl("nats://localhost:4222")


.clusterId("cluster-id").clientId("yourclientid").build());

   final StreamingConnection connection = cf.createConnection();
   Assert.assertNotNull(connection);

   connection.close();
   }

It fails with a timeout.

I monitored the connection with wireshark, and see the following

< = from server to client

= from client to server


<{"server_id":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","server_name":"NDMRYDSGUSH2QR6SZWMFB44ND5CODXGKNYTQ5IPLUGYUDBI6G54CIGF6","version":"2.1.4","proto":1,"git_commit":"fb009af","go":"go1.13.7","host":"0.0.0.0","port":4222,"max_payload":1048576,"client_id":10}

CONNECT

{"lang":"java","version":"2.6.5","name":"yourclientid","protocol":1,"verbose":false,"pedantic":false,"tls_required":false,"echo":true}

PING


SUB _STAN.acks.LP4bdY88abuVJ19Qo5HVuk 1
SUB _INBOX.LP4bdY88abuVJ19Qo5HVn8 2
SUB _INBOX.LP4bdY88abuVJ19Qo5HVqw 3
SUB _INBOX.F0vVy1N0sQM3xseeEWMIAL.* 4
PUB _STAN.discover.cluster-id

_INBOX.F0vVy1N0sQM3xseeEWMIAL.F0vVy1N0sQM3xseeEWMISH 75

.yourclientid.._INBOX.LP4bdY88abuVJ19Qo5HVn8..".LP4bdY88abuVJ19Qo5HVjK(.0.


PONG
UNSUB 1
UNSUB 2
UNSUB 3

So there does appear to be some communication between my test and the

NATS

server - I have no idea why it times out.

My code is here if you want to have a go:
https://github.com/jgallimore/tomee-chatterbox/tree/nats

Jon

On Wed, Jun 9, 2021 at 11:56 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


Nervermind, I figured out my mistake. I'll post back when I have

something

going.

Jon

On Wed, Jun 9, 2021 at 11:44 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:


I think I have something wired up, but when executing this:

   cf = new
   StreamingConnectionFactory(new
Options.Builder().natsUrl(baseAddress)

.clusterId("cluster-id").clientId("client-id").build());

   connection = cf.createConnection();


connection is null. Any pointers?

Jon

On Wed, Jun 9, 2021 at 8:16 AM Matthew Broadhead
 wrote:


i have never used a JCA adapter before.  is it loaded in using the
tomee.xml as a Resource?  and then injected into a singleton for
subscribing to messages?

On 08/06/2021 17:15, Jonathan Gallimore wrote:

Definitely sounds like a good case for a JCA adapter. I'll take a

quick

swing at hooking up an example for you.

Jon

On Tue, Jun 8, 2021 at 9:02 AM Matthew Broadhead
 wrote:


Hi Jon,

NATS is basically a message queue, like ActiveMQ I suppose.

I included the adapter into the project using maven

  io.nats
  java-nats-streaming
  2.2.3


i started up a nats server using docker.  here is my