Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Icipher
Hey guys,

I'm trying to find a way to forward messages from ActiveMQ (component from
Eclipse Hono) to RabbitMQ via a Qpid Dispatch Router.

This is the current configuration:

[
  ["router", {
    "id": "Hono.Example.Router",
    "mode": "standalone",
    "workerThreads": 3
  }],

  ["authServicePlugin", {
    "name": "Hono Auth",
    "host": "hono-service-auth.hono",
    "port": 5671,
    "sslProfile": "internal"
  }],

  ["sslProfile", {
    "name": "external",
    "certDb": "/run/secrets/trusted-certs.pem",
    "certFile": "/run/secrets/qdrouter-cert.pem",
    "keyFile": "/run/secrets/qdrouter-key.pem"
  }],

  ["sslProfile", {
    "name": "internal",
    "certDb": "/run/secrets/trusted-certs.pem",
    "certFile": "/run/secrets/qdrouter-cert.pem",
    "keyFile": "/run/secrets/qdrouter-key.pem",
    "uidFormat": "oun"
  }],

  ["listener", {
    "sslProfile": "external",
    "requireSsl": true,
    "host": "0.0.0.0",
    "port": 5671,
    "authenticatePeer": true,
    "saslMechanisms": "PLAIN",
    "saslPlugin": "Hono Auth"
  }],

  ["listener", {
    "host": "0.0.0.0",
    "port": 5672,
    "authenticatePeer": true,
    "saslMechanisms": "PLAIN",
    "saslPlugin": "Hono Auth"
  }],

  ["listener", {
    "sslProfile": "internal",
    "requireSsl": true,
    "host": "0.0.0.0",
    "port": 5673,
    "authenticatePeer": true,
    "saslMechanisms": "EXTERNAL"
  }],

  ["connector", {
    "sslProfile": "external",
    "name": "broker",
    "host": "hono-artemis.hono",
    "port": 5671,
    "role": "route-container",
    "saslUsername": "artemis",
    "saslPassword": "artemis"
  }],

  ["connector", {
    "name": "mybroker",
    "role": "route-container",
    "host": "rabbitmq_amqp",
    "port": "5672",
    "saslMechanisms": "PLAIN",
    "saslUsername": "atnoguser",
    "saslPassword": "atnogpass"
  }],

  ["linkRoute", {
    "prefix": "event/",
    "dir": "in",
    "connection": "broker"
  }],

  ["linkRoute", {
    "prefix": "event/",
    "dir": "out",
    "connection": "broker"
  }],

  ["address", {
    "prefix": "telemetry"
  }],

  ["autoLink", {
    "addr": "telemetry",
    "dir": "in",
    "connection": "broker"
  }],  

  ["autoLink", {
    "addr": "telemetry",
    "dir": "out",
    "connection": "mybroker"
  }],

   ["autoLink", {
    "addr": "telemetry",
    "dir": "out",
    "connection": "broker"
  }],

   ["autoLink", {
    "addr": "telemetry",
    "dir": "in",
    "connection": "mybroker"
  }],

  ["policy", {
    "maxConnections": 1000,
    "enableVhostPolicy": true,
    "defaultVhost": "hono"
  }],

  ["vhost", {
      "id": "hono",
      "maxConnections": 500,
      "maxConnectionsPerUser": 20,
      "maxConnectionsPerHost": 10,
      "allowUnknownUser": true,
      "groups": {
        "$default": {
          "remoteHosts": "*",
          "maxSessions": 10
        }
      }
  }],

  ["vhost", {
      "id": "hono-internal",
      "maxConnections": 9,
      "groups": {
        "Hono": {
          "users": "Eclipse IoT;Hono;hono-messaging, Eclipse
IoT;Hono;http-adapter, Eclipse IoT;Hono;mqtt-adapter, Eclipse
IoT;Hono;kura-adapter, Eclipse IoT;Hono;amqp-adapter, Eclipse
IoT;Hono;coap-adapter",
          "remoteHosts": "*",
          "maxSessions": 2,
          "maxFrameSize": 16384,
          "maxSessionWindow": 6553600,
          "maxMessageSize": 131072,
          "allowUserIdProxy": true,
          "targets": "telemetry/*, event/*"
        }
      }
  }],

  ["vhost", {
    "id": "hono-kura-internal",
    "maxConnections": 30,
    "groups": {
      "Hono": {
        "users": "Eclipse IoT;Hono;kura-adapter",
        "remoteHosts": "*",
        "allowUserIdProxy": true,
        "sources": "control/*",
        "targets": "control/*"
      }
    }
  }],

  ["vhost", {
    "id": "hono-mqtt-internal",
    "maxConnections": 30,
    "groups": {
      "Hono": {
        "users": "Eclipse IoT;Hono;mqtt-adapter",
        "remoteHosts": "*",
        "allowUserIdProxy": true,
        "sources": "control/*",
        "targets": "control/*"
      }
    }
  }],

  ["vhost", {
    "id": "hono-amqp-internal",
    "maxConnections": 30,
    "groups": {
      "Hono": {
        "users": "Eclipse IoT;Hono;amqp-adapter",
        "remoteHosts": "*",
        "allowUserIdProxy": true,
        "sources": "control/*",
        "targets": "control/*"
      }
    }
  }],

  ["vhost", {
    "id": "hono-http-internal",
    "maxConnections": 30,
    "groups": {
      "Hono": {
        "users": "Eclipse IoT;Hono;http-adapter",
        "remoteHosts": "*",
        "allowUserIdProxy": true,
        "sources": "control/*",
        "targets": "control/*"
      }
    }
  }],

  ["vhost", {
    "id": "hono-coap-internal",
    "maxConnections": 30,
    "groups": {
      "Hono": {
        "users": "Eclipse IoT;Hono;coap-adapter",
        "remoteHosts": "*",
        "allowUserIdProxy": true,
        "sources": "control/*",
        "targets": "control/*"
      }
    }
  }],

  ["log", {
    "module": "DEFAULT",
    "enable": "info+"
  }]
]


I can connect to RabbitMQ but I can't forward the messages (telemetry
adress) from <broker> to <mybroker>. (Queue shows 0 messages)
What am I doing wrong?

Hope you guys can help me!

Best regards



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Gordon Sim
On 04/02/19 16:47, Icipher wrote:
> I'm trying to find a way to forward messages from ActiveMQ (component from
> Eclipse Hono) to RabbitMQ via a Qpid Dispatch Router.
[...]
> I can connect to RabbitMQ but I can't forward the messages (telemetry
> adress) from <broker> to <mybroker>. (Queue shows 0 messages)
> What am I doing wrong?

As you have set it up, rabbitmq is used alongside the activemq broker
i.e. messages sent to the telemetry address would be divided between
them. However this requires that the address defined for telemetry has
waypoint: true in it.

Is this  what you want? Or do you want messages first to go to the
activemq broker, then from there to the rabbitmq broker? If so you need
to change the phase of the 'out' autolink to mybroker to be 1, in which
case that link would compete with consuming links on the telemetry
address from clients (if you didn't want that you would remove the 'in'
autolink for the other broker).

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Icipher
I don't want them to be divided between the two brokers.
I want them to go to ActiveMQ and then to be forwarded to RabbitMQ.
Sorry I didn't understand the part of competing with consuming links. With
phase out = 1, mybroker would act as a consumer? Is that right?
Thanks for helping me :)



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Chuck Rolke
Delete the section that has the "telemetry" "in". Otherwise the router will
connect and read messages from that address thus competing with your other
consumers.

The phase numbers help stage message flow through the router. Since there is
only one autoLink, don't specify a phase in the config. Then the default
phase for an out autoLink will be applied.


----- Original Message -----

> From: "Icipher" <[hidden email]>
> To: [hidden email]
> Sent: Tuesday, February 12, 2019 6:59:04 AM
> Subject: Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router
>
> I don't want them to be divided between the two brokers.
> I want them to go to ActiveMQ and then to be forwarded to RabbitMQ.
> Sorry I didn't understand the part of competing with consuming links. With
> phase out = 1, mybroker would act as a consumer? Is that right?
> Thanks for helping me :)
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Icipher
I tried to remove the section that has telemetry "in" but no success,
messages are not propagated to rabbitmq..



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Forward messages from ActiveMQ to RabbitMQ via Qpid Dispatch Router

Gordon Sim
On 26/02/2019 11:45 am, Icipher wrote:
> I tried to remove the section that has telemetry "in" but no success,
> messages are not propagated to rabbitmq..

I think you want something like this:

   ["address", {
     "prefix": "telemetry",
     "waypoint": true
   }],

   ["autoLink", {
     "addr": "telemetry",
     "dir": "out",
     "phase": 1,
     "connection": "mybroker"
   }],

    ["autoLink", {
     "addr": "telemetry",
     "dir": "out",
     "phase": 0,
     "connection": "broker"
   }],

   ["autoLink", {
     "addr": "telemetry",
     "dir": "in",
     "phase": 1,
     "connection": "broker"
   }],

Messages will go over the out link to broker (phase 0), then back into
the router (phase 1) and then out to mybroker.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]