Hello,

Thank you Ganesh for your answer.
To answer your first question yes the consumers we have, issue one credit
per call.
For the the second question, yes we are attaching consumers before sending
the messages.

After setting the dispatch "link capacity" on the listeners to 1, we
managed to have an equal load-balancing of the messages between consumer 1
and 2.
Our understanding is that the problem comes from the prefetch at the level
of the "normal" listener, which is preventing the "inter-router" listener
to pass messages to the second dispatch.

You can find attached the new config files.

Is this the correct way to resolve this kind of problem? Does it sound
reasonable to you?

Best regards,
Rabih and Ali

On Thu, Jul 11, 2019 at 5:50 PM Ganesh Murthy <[email protected]> wrote:

>
>
> On Thu, Jul 11, 2019 at 10:37 AM Rabih M <[email protected]> wrote:
>
>> Hello,
>>
>> We are using Qpid dispatch router 1.7, Qpid broker 7.1.3 on redhat linux
>> rhel 6.4.
>>
>> Use case description:
>> We have a cluster of 2 dispatch routers and 2 brokers. A sharded queue
>> "myQueue" on the 2 brokers.
>> Here is an illustration:
>>
>> [image: Diagram.jpg]
>>
>> The producer produces 2 messages, the messages are load balanced on the 2
>> brokers. Then, Consumer 1 and consumer 2 ask for a receive().
>>
> Does your receive() function issue one credit per call?
>
>>
>> Our observation is that the consumer 1 consumes the first message and the
>> consumer 2 is never getting the second message.
>> We are aware that the first dispatch router will do a prefetch for the 2
>> messages but what is weird is that the prefetched message 2 is never routed
>> to the second dispatch router and consumer 2.
>> I attached the dispatch routers config.
>>
>> This is what is going on in my view -
> 1. The producer sends two messages - Message 1 goes to Broker 1 and
> Message 2 goes to Broker 2.
> 2. Now Consumer 1 attaches to Router 1 and calls receive() issuing one
> credit. (The Consumer 2 has not yet attached to Router 2). The autolinks
> from Broker 1 to Router 1 and Broker 2 to Router 2 each have a prefetch of
> 250 credits each. So,Message 1 and Message 2
> both come down to Router 1. Message 1 is sent to Consumer 1. Message 2 is
> waiting on the outbound queue of Consumer 1 waiting to receive a credit
> from Consumer 1.
> 3. Now Consumer 2 shows up and wants to receive Message 2 but that message
> is already queued up to go to Consumer 1 who is still keeping his
> connection open
> 4. If now Consumer 1 drops out, the Message 2 will be RELEASED back to its
> broker and that message will be sent to Consumer 2.
>
> Have you tried attaching Consumer 1 and Consumer 2 first and then
> subsequently bringing up the Producer 1 and send two messages ? In that
> case, I think, both consumers will receive one message.
>
> Thanks.
>
>> Do you have any idea how we can make consumer 2 receive the message?
>>
>> Thanks for your help,
>> Rabih
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>
>
router {
        mode: interior
        id: ${dispatch.router.name}
        workerThreads: 4
        defaultDistribution: unavailable
}

listener {
        name: normal_listener
        host: 0.0.0.0
        port: 0
        role: normal
        saslMechanisms: ANONYMOUS
        requireSsl: no
        authenticatePeer: no
        linkCapacity: 1
}

listener {
        name: inter_router_listener
        host: 0.0.0.0
        port: 0
        role: inter-router
        saslMechanisms: ANONYMOUS
        requireSsl: no
        authenticatePeer: no
        linkCapacity: 1
}

log {
        module: DEFAULT
        enable: info+
        includeSource: false
        outputFile: stdout
}

connector {
    name: broker1
    role: route-container
    host: 127.0.0.1
    port: ${broker1.amqp.port}
}

connector {
    name: broker2
    role: route-container
    host: 127.0.0.1
    port: ${broker2.amqp.port}
}

address {
    prefix: myQueue
    waypoint: yes
}

autoLink {
    name: consume_myQueue_broker1
    addr: myQueue
    connection: broker1
    direction: in
}

address {
    prefix: myTopic
    waypoint: yes
}

autoLink {
    name: produce_myTopic_broker1
    addr: myTopic
    connection: broker1
    direction: out
}

autoLink {
    name: consume_myQueue_broker2
    addr: myQueue
    connection: broker2
    direction: in
}

autoLink {
    name: produce_myTopic_broker2
    addr: myTopic
    connection: broker2
    direction: out
}
router {
        mode: interior
        id: ${dispatch.router.name}
        workerThreads: 4
        defaultDistribution: unavailable
}

listener {
        name: normal_listener
        host: 0.0.0.0
        port: 0
        role: normal
        saslMechanisms: ANONYMOUS
        requireSsl: no
        authenticatePeer: no
        linkCapacity: 1
}

listener {
        name: inter_router_listener
        host: 0.0.0.0
        port: 0
        role: inter-router
        saslMechanisms: ANONYMOUS
        requireSsl: no
        authenticatePeer: no
        linkCapacity: 1
}

log {
        module: DEFAULT
        enable: info+
        includeSource: false
        outputFile: stdout
}

connector {
    name: dispatch1
    role: inter-router
    host: 127.0.0.1
    port: ${dispatch1.inter.router.port}
}

connector {
    name: broker1
    role: route-container
    host: 127.0.0.1
    port: ${broker1.amqp.port}
}

connector {
    name: broker2
    role: route-container
    host: 127.0.0.1
    port: ${broker2.amqp.port}
}

address {
    prefix: myQueue
    waypoint: yes
}

autoLink {
    name: consume_myQueue_broker1
    addr: myQueue
    connection: broker1
    direction: in
}

address {
    prefix: myTopic
    waypoint: yes
}

autoLink {
    name: produce_myTopic_broker1
    addr: myTopic
    connection: broker1
    direction: out
}

autoLink {
    name: consume_myQueue_broker2
    addr: myQueue
    connection: broker2
    direction: in
}

autoLink {
    name: produce_myTopic_broker2
    addr: myTopic
    connection: broker2
    direction: out
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to