[ 
https://issues.apache.org/jira/browse/DISPATCH-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15890393#comment-15890393
 ] 

Ganesh Murthy commented on DISPATCH-641:
----------------------------------------

When you declare a linkRoute like this - 
{noformat}
linkRoute {
    prefix: myqueue
    containerId: xxx
    dir: in
}
{noformat}
The containerId specified in a link route is the target containerId to which a 
client attach will be forwarded. When the client attaches with a target 
address, this address is matched to see if the prefix matches the prefix 
specified in the link route. If it matches, the router tries to find the 
container to forward the attach to. If it successfully finds a container with 
containerId xxx (say this is a broker), it forwards that attach to the broker. 
If no container with the containerId exists, the attach cannot be forwarded 
anywhere and hence you will see a "No route to destination" error

In your Scenario B,  the client containerId (which is xxx in your case) is 
immaterial and ignored. The containerId specified in the link route is always 
the target container to which the attach frame will be forwarded to. So, what 
you are asking in Scenario B is not possible.

Please let me know if you have questions.

> Make containerId attribute work with clients
> --------------------------------------------
>
>                 Key: DISPATCH-641
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-641
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Router Node
>    Affects Versions: 0.7.0
>            Reporter: Matej Lesko
>
> During verification of issue 
> https://issues.apache.org/jira/browse/DISPATCH-628
> I found out that when I set this _containerId_ in the clients, router can see 
> it but it can not route it. 
> E.g. I have sender with the _containerId_ "xxx" and autoLink entity with the 
> _containerId_ "xxx" ->
> this autoLink does not activate in this scenario. 
> Simply said when I have sender/receiver with the _containerId_ set and 
> matching the _containerId_ attribute in the configuration file, it does 
> *not* accept the connection. e.g. _linkRoute_ usage ends with the  "Link 
> error: No route to the destination node".
> Possible configuration to use(same applies for _autoLink_ entities)
> {noformat}
> router {
>     mode: standalone
>     id: Router.A
> }
> listener {
>     host: 0.0.0.0
>     port: amqp
>     authenticatePeer: no
>     saslMechanisms: ANONYMOUS
> }
> connector {
>     name: broker
>     host: MY-HOST
>     role: route-container
>     port: amqp
> }
> address {
>     prefix: jms.queue
>     waypoint: yes
>     distribution: balanced
> }
> linkRoute {
>     name: myqueueIn
>     dir: in
>     prefix: jms.queue.myqueue
>     connection: broker
>     containerId: dtest
> }
> linkRoute {
>     name: myqueueOut
>     dir: out
>     prefix: jms.queue.myqueue
>     connection: broker
>     containerId: dtest
> }
> log {
>     module: MESSAGE
>     enable: debug
>     timestamp: yes
> }
> {noformat}
> Right now, router works only as described e.g. here 
> [https://issues.apache.org/jira/browse/DISPATCH-640|DISPATCH-640]
> In such a case, it is important to set a *name* (aka container_id) for the 
> broker, matching the value of _containerId_ attribute of the chosen 
> linkRoute/autoLink entity. Then all messages are routed to this broker, 
> ignoring the value of _container_id_ of the actual client itself.
> Request is that this value would be used to "specify" which clients would 
> actually be allowed to make a connection to the broker.
> Usages:
> Scenario A:
> 1. Client has containerId=xxx, address="myqueue"
> 2. linkRoute has containerId=yyy, prefix="myqueue"
> resolution: connection won't be established, not matching containerId
> Scenario B:
> 1. Client has containerId=xxx, address="myqueue"
> 2. linkRoute has containerId=xxx, prefix="myqueue"
> resolution: connection will be established, client sends messages to the 
> broker
> As described in 
> [https://issues.apache.org/jira/browse/DISPATCH-639|DISPATCH-639]  -> 
> "if there is a container field, use it otherwise use the connection_field to 
> specify the connection to use."
> This could be elevated to the use case, where an condition as:
> "if there is container field and also connection_field specified, demand 
> matching containerId from the client"



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to