You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by David Jencks <da...@gmail.com> on 2021/11/28 17:58:15 UTC

[Website] activemq URI syntax inconsistency

On the Activemq component page, there are two descriptions of the URI syntax:

hardcoded in the .adoc source, https://camel.apache.org/components/next/activemq-component.html#_uri_format:   activemq:[queue:|topic:]destinationName[?options]


from the .json component.syntax property, shown at https://camel.apache.org/components/next/activemq-component.html#_endpoint_options: activemq:destinationType:destinationName

In the immediately following table, the default for destinationType is listed as “queue”, so evidently it can be left out.

The first syntax results in activemq:destinationName whereas the second results in activemq::destinationName (one vs two colons).

- Which is correct?
- If the first, should the component.syntax property be activemq:[destinationType:]destinationName ?

In any case, should there be a distinction between literals such as ‘activemq’ or ‘queue’ and symbols such as ‘destinationName’ (e.g. `<destinationName>`)?

David Jencks

Re: [Website] activemq URI syntax inconsistency

Posted by David Jencks <da...@gmail.com>.
Perhaps there are (at least) two issues here:

1. How many colons?

The “grammar” activemq:destinationType:destinationName can’t possibly under any interpretation yield a sentence with one colon, so something like activemq:[destinationType:]destinationName is more correct.

2. What are the destinationTypes?

The text in activemq.adoc says [queue|topic] but JmsEndpoint has
```
@UriPath(defaultValue = "queue", enums = "queue,topic,temp-queue,temp-topic",
         description = "The kind of destination to use")
private String destinationType;
```
indicating 4 possibilities.

——
Is the syntax string from the java code used programmatically, or is it purely documentation?

Looking at several of these in the docs, I have some trouble telling what is a literal and what is a name of a path option.

I would prefer the syntax expression to indicate optional path options and to distinguish between literals and options.  So, for activemq it would look like

activemq:[<destinationType>:]<destinationName>

I wonder if it would be useful also to point out in the hand-written URI Format section that this is a simplification of what is completely described in the Endpoint Options section.

I haven’t considered how hard it would be to update the syntax source and docs for all the components, but if it is agreed to be a good idea I’d consider it.

David Jencks

> On Nov 28, 2021, at 10:15 PM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Hi
> 
> The correct syntax is in the json file, that are taken from the source code
> 
> You are not correct about 2 colons, as when the option is left out (to
> use its default value) then the colon is not needed either, so you
> just use
> 
> activemq:cheese
> 
> when its a queue, and if you need topic then use
> 
> activemq:topic:wines
> 
> 
> 
> On Sun, Nov 28, 2021 at 6:58 PM David Jencks <da...@gmail.com> wrote:
>> 
>> On the Activemq component page, there are two descriptions of the URI syntax:
>> 
>> hardcoded in the .adoc source, https://camel.apache.org/components/next/activemq-component.html#_uri_format:   activemq:[queue:|topic:]destinationName[?options]
>> 
>> 
>> from the .json component.syntax property, shown at https://camel.apache.org/components/next/activemq-component.html#_endpoint_options: activemq:destinationType:destinationName
>> 
>> In the immediately following table, the default for destinationType is listed as “queue”, so evidently it can be left out.
>> 
>> The first syntax results in activemq:destinationName whereas the second results in activemq::destinationName (one vs two colons).
>> 
>> - Which is correct?
>> - If the first, should the component.syntax property be activemq:[destinationType:]destinationName ?
>> 
>> In any case, should there be a distinction between literals such as ‘activemq’ or ‘queue’ and symbols such as ‘destinationName’ (e.g. `<destinationName>`)?
>> 
>> David Jencks
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: [Website] activemq URI syntax inconsistency

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The correct syntax is in the json file, that are taken from the source code

You are not correct about 2 colons, as when the option is left out (to
use its default value) then the colon is not needed either, so you
just use

activemq:cheese

when its a queue, and if you need topic then use

activemq:topic:wines



On Sun, Nov 28, 2021 at 6:58 PM David Jencks <da...@gmail.com> wrote:
>
> On the Activemq component page, there are two descriptions of the URI syntax:
>
> hardcoded in the .adoc source, https://camel.apache.org/components/next/activemq-component.html#_uri_format:   activemq:[queue:|topic:]destinationName[?options]
>
>
> from the .json component.syntax property, shown at https://camel.apache.org/components/next/activemq-component.html#_endpoint_options: activemq:destinationType:destinationName
>
> In the immediately following table, the default for destinationType is listed as “queue”, so evidently it can be left out.
>
> The first syntax results in activemq:destinationName whereas the second results in activemq::destinationName (one vs two colons).
>
> - Which is correct?
> - If the first, should the component.syntax property be activemq:[destinationType:]destinationName ?
>
> In any case, should there be a distinction between literals such as ‘activemq’ or ‘queue’ and symbols such as ‘destinationName’ (e.g. `<destinationName>`)?
>
> David Jencks



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2