stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

Support Artemis JMS/JNDI Destination Names in Unit Tests #128

Closed gmallard closed 6 years ago

gmallard commented 8 years ago

Background: Artemis by default uses a JMS/JNDI style of destination names.

Each destination name is prefixed by 'jms.queue.', and the separator character for destinations is a period ('.').

Example destination names:

jms.queue.Q1
jms.queue.AnotherQ.a.b.1
jms.queue.MyQueue.Special

Changes:

Add support of a STOMP_ARTEMIS environment variable to detect if Artemis is the broker used.

Modify _test/testhelper.rb method _makedestination to detect the STOMP_ARTEMIS environment variable, and return a proper destination name.

Modify other unit tests as required to support Artemis destination names, and any observed broker specific behavior.

With this modification, unit tests that resemble the following should run:

STOMP_ARTEMIS=y STOMP_PORT=31613 rake test --trace
STOMP_ARTEMIS=y STOMP_PORT=31613 STOMP_TEST11p=1.1 rake test --trace
STOMP_ARTEMIS=y STOMP_PORT=31613 STOMP_TEST11p=1.2 rake test --trace
gmallard commented 8 years ago

@mikola-spb Since you run Artemis, ..... are you interested in working on this?

Let me know please.

Regards, Guy

gmallard commented 8 years ago

Needs to support topics as well.

mikola-spb commented 7 years ago

Hi, sorry missed you comment. I won't promise but will try to have a look. Support of Artemis in tests is a good thing for sure

gmallard commented 6 years ago

Artemis support in unit tests was completed in stages. For the record, I use the following for unit tests:

#!/bin/sh
#
set -x
pref="STOMP_PORT=61613 rake test --trace"
echo =============== AMQ Stomp 1.0 ===============
eval $pref

pref="STOMP_PORT=61613 STOMP_TEST11p=1.1 STOMP_AMQ11=y STOMP_NOWILD=y rake test --trace"
echo =============== AMQ Stomp 1.1 ===============
eval $pref

pref="STOMP_PORT=61613 STOMP_TEST11p=1.2 STOMP_AMQ11=y STOMP_NOWILD=y rake test --trace"
echo =============== AMQ Stomp 1.2 ===============
eval $pref

pref="STOMP_TESTSSL=y STOMP_PORT=62613 STOMP_SSLPORT=62610 STOMP_DOTQUEUE=y STOMP_NOWILD=y rake test --trace"
echo =============== Apollo Stomp 1.0 ===============
eval $pref

pref="STOMP_TESTSSL=y STOMP_PORT=62613 STOMP_SSLPORT=62610 STOMP_DOTQUEUE=y STOMP_TEST11p=1.1 STOMP_NOWILD=y STOMP_APOLLO=y rake test --trace"
echo =============== Apollo Stomp 1.1 ===============
eval $pref

pref="STOMP_TESTSSL=y STOMP_PORT=62613 STOMP_SSLPORT=62610 STOMP_DOTQUEUE=y STOMP_TEST11p=1.2 STOMP_NOWILD=y STOMP_APOLLO=y rake test --trace"
echo =============== Apollo Stomp 1.2 ===============
eval $pref

pref="STOMP_TESTSSL=y STOMP_PORT=62613 STOMP_SSLPORT=62610 STOMP_DOTQUEUE=y STOMP_TEST11p=1.2 STOMP_NOWILD=y STOMP_CRLF=y STOMP_APOLLO=y rake test --trace"
echo =============== Apollo Stomp 1.2 - CRLF=y ===============
eval $pref

pref="STOMP_TESTSSL=y STOMP_PORT=62613 STOMP_SSLPORT=62610 STOMP_DOTQUEUE=y STOMP_TEST11p=1.2 STOMP_NOWILD=y STOMP_CONN=y STOMP_APOLLO=y rake test --trace"
echo =============== Apollo Stomp 1.2 - CONN=y ===============
eval $pref

pref="STOMP_RABBIT=y STOMP_PORT=41613 STOMP_DOTQUEUE=y STOMP_NOWILD=y rake test --trace"
echo =============== RabbitMQ Stomp 1.0 ===============
eval $pref

pref="STOMP_RABBIT=y STOMP_PORT=41613 STOMP_DOTQUEUE=y STOMP_NOWILD=y STOMP_TEST11p=1.1 rake test --trace"
echo =============== RabbitMQ Stomp 1.1 ===============
eval $pref

pref="STOMP_RABBIT=y STOMP_PORT=41613 STOMP_DOTQUEUE=y STOMP_NOWILD=y STOMP_TEST11p=1.2 rake test --trace"
echo =============== RabbitMQ Stomp 1.2 ===============
eval $pref

pref="STOMP_ARTEMIS=y STOMP_PORT=31613 STOMP_NOWILD=y rake test --trace"
echo =============== Artemis Stomp 1.0 ===============
eval $pref

pref="STOMP_ARTEMIS=y STOMP_PORT=31613 STOMP_NOWILD=y STOMP_TEST11p=1.1 rake test --trace"
echo =============== Artemis Stomp 1.1 ===============
eval $pref

pref="STOMP_ARTEMIS=y STOMP_PORT=31613 STOMP_NOWILD=y STOMP_TEST11p=1.2 rake test --trace"
echo =============== Artemis Stomp 1.2 ===============
eval $pref

set +x
exit 0