Run embedded activemq broker on the servlet container port

wazz

I have a jar-packed application which starts tomcat with servlets on some port (e.g. 8080). Also I need to add activemq broker (client side) to this application, use it embedded with the same JVM.

I think I'll do it in code smt like

BrokerService broker = new BrokerService();
broker.setBrokerName("myBroker");
broker.addConnector("tcp://localhost:40001");
broker.start();

My question is do I have to start it on another port? Is there any possibility to start it on the same port on which webserver starts?

robert

You can't do that because your application "binds" to the port and gets exclusive ownership of it. In purely logical terms how could the operating system otherwise know which application (Tomcat / ActiveMQ) to forward the request to?

In order to do what you need you must have another app called a "port multiplexer" bound as intermediary. Here's an example: https://github.com/joushou/serve2d

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is it possible to embed activemq broker into my servlet-container?

From Dev

Is it possible to embed activemq broker into my servlet-container?

From Dev

How to enable web console on ActiveMq embedded broker

From Dev

ActiveMQ: how to programmatically monitor embedded broker

From Dev

Exception when restarting embedded activeMQ broker with jdbcPersistenceAdapter

From Dev

Cannot concurrently consume from ActiveMQ embedded broker

From Dev

How to enable web console on ActiveMq embedded broker

From Dev

Spring Boot WebSocket with embedded ActiveMQ Broker

From Dev

ActiveMQ 5.8 network of broker with custom jmx port

From Dev

ActiveMQ embedded broker hanging when sending a Post request

From Dev

How to configure embedded ActiveMQ Broker URL with Spring Boot

From Dev

How to configure embedded ActiveMQ Broker URL with Spring Boot

From Dev

Spring boot without embedded servlet container

From Dev

Monitoring Broker Redelivery with ActiveMQ

From Dev

ActiveMQ broker not starting

From Dev

ActiveMQ inactive broker

From Dev

Configure ActiveMQ broker in grails

From Dev

Activemq broker url

From Dev

Spring boot: Unable to start embedded Tomcat servlet container

From Dev

Embedded AMQP Java Broker

From Dev

Use ActiveMQ JAR with an older broker

From Dev

How provide reliability of ActiveMQ broker?

From Dev

Unable to create queues in ActiveMQ broker

From Dev

docker-machine, create and run a nginx container is not exposing port 80

From Dev

ActiveMQ broker redelivery vs consumer redelivery

From Dev

Splitting activemq broker configuration into multiple files

From Dev

Failed to configure custom ActiveMQ broker in TomEE

From Dev

ActiveMQ Artemis running multiple web consoles for broker

From Dev

Get AMQ Message via ActiveMQ Broker Plugin

Related Related

  1. 1

    Is it possible to embed activemq broker into my servlet-container?

  2. 2

    Is it possible to embed activemq broker into my servlet-container?

  3. 3

    How to enable web console on ActiveMq embedded broker

  4. 4

    ActiveMQ: how to programmatically monitor embedded broker

  5. 5

    Exception when restarting embedded activeMQ broker with jdbcPersistenceAdapter

  6. 6

    Cannot concurrently consume from ActiveMQ embedded broker

  7. 7

    How to enable web console on ActiveMq embedded broker

  8. 8

    Spring Boot WebSocket with embedded ActiveMQ Broker

  9. 9

    ActiveMQ 5.8 network of broker with custom jmx port

  10. 10

    ActiveMQ embedded broker hanging when sending a Post request

  11. 11

    How to configure embedded ActiveMQ Broker URL with Spring Boot

  12. 12

    How to configure embedded ActiveMQ Broker URL with Spring Boot

  13. 13

    Spring boot without embedded servlet container

  14. 14

    Monitoring Broker Redelivery with ActiveMQ

  15. 15

    ActiveMQ broker not starting

  16. 16

    ActiveMQ inactive broker

  17. 17

    Configure ActiveMQ broker in grails

  18. 18

    Activemq broker url

  19. 19

    Spring boot: Unable to start embedded Tomcat servlet container

  20. 20

    Embedded AMQP Java Broker

  21. 21

    Use ActiveMQ JAR with an older broker

  22. 22

    How provide reliability of ActiveMQ broker?

  23. 23

    Unable to create queues in ActiveMQ broker

  24. 24

    docker-machine, create and run a nginx container is not exposing port 80

  25. 25

    ActiveMQ broker redelivery vs consumer redelivery

  26. 26

    Splitting activemq broker configuration into multiple files

  27. 27

    Failed to configure custom ActiveMQ broker in TomEE

  28. 28

    ActiveMQ Artemis running multiple web consoles for broker

  29. 29

    Get AMQ Message via ActiveMQ Broker Plugin

HotTag

Archive