jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-94) Define what characters are valid in a durable (or shared subscription) name

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 12 Nov 2012 15:48:35 +0000

You may remember this issue from several months ago.

On 17/04/2012 17:58, Nigel Deakin wrote:
> I have created this JIRA issue:
> http://java.net/jira/browse/JMS_SPEC-94
>
> Define what characters are valid in a durable (or shared subscription) name
> ---------------------------------------------------------------------------
>
> The JMS 1.1 specification does not specify what characters are valid in a durable subscription name.
> It is proposed that the JMS 2.0 specification defines a minimum set of characters which are valid in a durable or
> non-durable subscription name.
>
> This is needed to allow portable applications to be created. It is also needed because EJB_SPEC-41 states that if a MDB
> is defined with {{subscriptionDurability}} set to {{Durable}} but {{subscriptionName}} is not set then the container
> will automatically set {{subscriptionName}} to a suitably unique global name of the MDB, and the container vendor needs
> to be sure that the name it generates will always be a legal subscription name.
>
> ---------------------------------------------------------------------------
>
> Over on the EJB expert group they're discussing how to construct the default durable subscription name used for a MDB,
> and one suggestion included "/" characters.
>
> Does anyone know of any existing JMS providers which impose restrictions on what characters are valid?

So far I've discovered that
1. Oracle GlassFish Message Queue has no restrictions
2. Oracle Weblogic JMS does not allow the use of comma, equals, colon, asterisk, percent and question mark.

but I didn't receive any replies for other JMS providers.

As I wrote when I logged the issue, we need to define a minimum set of valid characters to allow an application server
or resource adapter to automatically set a durable or non-durable subscription name. (Strictly speaking we also need to
define the shortest length of string that all JMS providers are required to support)

To minimise the danger of choosing characters that a particular JMS provider cannot support I'd like to keep this set as
short as possible.

I would therefore like to suggest that we specify that the following characters must always be valid in a durable or
non-durable subscription name:

* Java letter or digit (as defined in Character.isLetterOrDigit)

* Underscore (_, or \u005f)

This gives basic support for human-readable names, plus a "combination" character which might be used when combining
strings together.

JMS Vendors may wish to support more characters than this, but if applications use only these specific characters for
their subscription names then they can be sure that they will work on any JMS provider.

Does anyone know of a JMS provider which cannot support this particular set of characters?

Nigel