Artemis federation over HTTP

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

Artemis federation over HTTP

sateesh kumar kapu
I am trying out federation example that is involving brokers on different
machines. I am able to establish connection using core protocols via TCP
however not able to make same thing with HTTP protocol.

According to documentation it is mentioned that broker identifies the HTTP
request and handles automatically but it does't seem to work.

I have the environment as below

          Broker 1  --> Load balancer (accepts http request on port 80) --
broker 2

How do we configure Connector and Acceptor to handle HTTP requests ? I tried
with multiple combinations but couldn't succeed

Broker 1
..
   <connectors>
         <connector
name="eu-west-1-connector">tcp://broker2Hostname:80</connector>
    </connectors>
   
     <acceptors>
         <acceptor
name="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
      </acceptors>
..

Broker 2
..
   <connectors>
         <connector
name="eu-east-1-connector">tcp://broker1Hostname:80</connector>
    </connectors>
   
     <acceptors>
         <acceptor
name="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
      </acceptors>
..

Basically I am looking for following questions
1) Does federation support HTTP protocol if so
2) How to configure the Connector and Acceptor for achieving same.

Thanks in advance for response.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Artemis federation over HTTP

jbertram
As I understand it, federation isn't concerned with the details of the
underlying network connection as that's abstracted away in the code-base.
Therefore, I don't think it's really a question of whether or not
federation itself supports HTTP. The question is more about whether or not
you've configured the connectors and acceptors properly for HTTP, and I
don't believe you have. I think you've got 2 problems.

First, you're not telling the *connector* to use HTTP. Try this on broker 1:

   <connectors>
      <connector
name="eu-west-1-connector">tcp://broker2Hostname:80?httpEnabled=true</connector>
   </connectors>

And this on broker 2:

   <connectors>
      <connector
name="eu-east-1-connector">tcp://broker1Hostname:80?httpEnabled=true</connector>
   </connectors>

Second, you're binding the acceptor to "localhost" which means only clients
running on the same box will be able to connect to it. Try this on broker 1:

   <acceptors>
      <acceptor name="netty-acceptor">tcp://broker1Hostname:80</acceptor>
   </acceptors>

And this on broker 2:

   <acceptors>
      <acceptor name="netty-acceptor">tcp://broker2Hostname:80</acceptor>
   </acceptors>

I don't think you'll need "httpEnabled=true" on the acceptors as they
should automatically detect the use of HTTP (as noted in the documentation).


Justin

On Fri, Feb 28, 2020 at 5:32 PM sateesh kumar kapu <[hidden email]>
wrote:

> I am trying out federation example that is involving brokers on different
> machines. I am able to establish connection using core protocols via TCP
> however not able to make same thing with HTTP protocol.
>
> According to documentation it is mentioned that broker identifies the HTTP
> request and handles automatically but it does't seem to work.
>
> I have the environment as below
>
>           Broker 1  --> Load balancer (accepts http request on port 80) --
> broker 2
>
> How do we configure Connector and Acceptor to handle HTTP requests ? I
> tried
> with multiple combinations but couldn't succeed
>
> Broker 1
> ..
>    <connectors>
>          <connector
> name="eu-west-1-connector">tcp://broker2Hostname:80</connector>
>     </connectors>
>
>      <acceptors>
>          <acceptor
> name="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
>       </acceptors>
> ..
>
> Broker 2
> ..
>    <connectors>
>          <connector
> name="eu-east-1-connector">tcp://broker1Hostname:80</connector>
>     </connectors>
>
>      <acceptors>
>          <acceptor
> name="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
>       </acceptors>
> ..
>
> Basically I am looking for following questions
> 1) Does federation support HTTP protocol if so
> 2) How to configure the Connector and Acceptor for achieving same.
>
> Thanks in advance for response.
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Artemis federation over HTTP

michael.andre.pearce
In reply to this post by sateesh kumar kapu
Federation works only over core protocol currently.Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: sateesh kumar kapu <[hidden email]> Date: 28/02/2020  23:32  (GMT+00:00) To: [hidden email] Subject: Artemis federation over HTTP I am trying out federation example that is involving brokers on differentmachines. I am able to establish connection using core protocols via TCPhowever not able to make same thing with HTTP protocol. According to documentation it is mentioned that broker identifies the HTTPrequest and handles automatically but it does't seem to work.I have the environment as below           Broker 1  --> Load balancer (accepts http request on port 80) --broker 2How do we configure Connector and Acceptor to handle HTTP requests ? I triedwith multiple combinations but couldn't succeed Broker 1 ..   <connectors>         <connectorname="eu-west-1-connector">tcp://broker2Hostname:80</connector>    </connectors>         <acceptors>         <acceptorname="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>      </acceptors>..Broker 2 ..   <connectors>         <connectorname="eu-east-1-connector">tcp://broker1Hostname:80</connector>    </connectors>         <acceptors>         <acceptorname="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>      </acceptors>..Basically I am looking for following questions 1) Does federation support HTTP protocol if so 2) How to configure the Connector and Acceptor for achieving same.Thanks in advance for response.--Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Artemis federation over HTTP

jbertram
In reply to this post by sateesh kumar kapu
> Federation works only over core protocol currently.

That's fair enough, but Netty connections using the core protocol can be
tunneled over HTTP. See the documentation [1] and this example [2] for more
details.


Justin

[1]
http://activemq.apache.org/components/artemis/documentation/latest/configuring-transports.html#configuring-netty-http
[2]
https://github.com/apache/activemq-artemis/tree/master/examples/features/standard/http-transport

On Fri, Feb 28, 2020 at 6:43 PM michael.andre.pearce
<[hidden email]> wrote:

> Federation works only over core protocol currently.Sent from my Samsung
> Galaxy smartphone.
> -------- Original message --------From: sateesh kumar kapu <
> [hidden email]> Date: 28/02/2020  23:32  (GMT+00:00) To:
> [hidden email] Subject: Artemis federation over HTTP I am
> trying out federation example that is involving brokers on
> differentmachines. I am able to establish connection using core protocols
> via TCPhowever not able to make same thing with HTTP protocol. According to
> documentation it is mentioned that broker identifies the HTTPrequest and
> handles automatically but it does't seem to work.I have the environment as
> below           Broker 1  --> Load balancer (accepts http request on port
> 80) --broker 2How do we configure Connector and Acceptor to handle HTTP
> requests ? I triedwith multiple combinations but couldn't succeed Broker 1
> ..   <connectors>
> <connectorname="eu-west-1-connector">tcp://broker2Hostname:80</connector>
> </connectors>         <acceptors>
> <acceptorname="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
> </acceptors>..Broker 2 ..   <connectors>
> <connectorname="eu-east-1-connector">tcp://broker1Hostname:80</connector>
> </connectors>         <acceptors>
> <acceptorname="netty-acceptor">tcp://localhost:80?httpEnabled=true</acceptor>
> </acceptors>..Basically I am looking for following questions 1) Does
> federation support HTTP protocol if so 2) How to configure the Connector
> and Acceptor for achieving same.Thanks in advance for response.--Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html