Load balancing based on topics

2016-10-07 Thread aries.aries
Hi,

Can someone please explain me how Artemis performs load balancing with
topics? I understand somewhat about how it does with jms queues but I don't
understand how the load balancing is done with respect to topics. Also is a
there a way I can configure Artemis to evenly distribute topics among
different nodes in a cluster? Thank you in advance.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Load-balancing-based-on-topics-tp4717664.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: java.io.EOFException when ActiveMQ starts

2016-10-07 Thread Tim Bain
It looks like the broker is failing to make the connection described in
your networkConnectors section of activemq.xml.  Can you show us that
config snippet?  And do you have any reason to believe that connection
might be failing?

Tim

On Oct 7, 2016 2:44 AM, "divinedragon"  wrote:

I am trying to start the ActiveMQ 5.11 and I see a WARNING as below:
 WARN | Transport Connection to: tcp://127.0.0.1:40890 failed:
java.io.EOFException
Here is the entire console log for this.
Java Runtime: Oracle Corporation 1.7.0_05 /usr/java/jdk1.7.0_05/jre  Heap
sizes: current=1004928k  free=994439k  max=1004928kJVM args: -Xmx1G
-Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties
-Djava.security.auth.login.config=/home/dragon/activemq/conf/login.config
-Dcom.sun.management.jmxremote -Djava.io.tmpdir=/home/dragon/activemq/tmp
-Dactivemq.classpath=/home/dragon/activemq/conf;
-Dactivemq.home=/home/dragon/activemq -Dactivemq.base=/home/dragon/activemq
-Dactivemq.conf=/home/dragon/activemq/conf
-Dactivemq.data=/home/dragon/activemq/dataExtensions classpath:
[/home/dragon/activemq/lib,/home/dragon/activemq/lib/
camel,/home/dragon/activemq/lib/optional,/home/dragon/
activemq/lib/web,/home/dragon/activemq/lib/extra]ACTIVEMQ_HOME:
/home/dragon/activemqACTIVEMQ_BASE: /home/dragon/activemqACTIVEMQ_CONF:
/home/dragon/activemq/confACTIVEMQ_DATA: /home/dragon/activemq/dataLoading
message broker from: xbean:activemq.xml INFO | Refreshing
org.apache.activemq.xbean.XBeanBrokerFactory$1@a842913: startup date [Fri
Oct 07 08:14:02 IST 2016]; root of context hierarchy INFO |
PListStore:[/home/dragon/activemq/data/divinedragonbox/tmp_storage] started
INFO | Using Persistence Adapter:
KahaDBPersistenceAdapter[/home/dragon/jms_store] INFO | JMX consoles can
connect to service:jmx:rmi:///jndi/rmi://localhost:15526/jmxrmi INFO |
KahaDB is version 5 INFO | Recovering from the journal ... INFO | Recovery
replayed 76 operations from the journal in 0.032 seconds. INFO | Apache
ActiveMQ 5.11.1 (divinedragonbox,
ID:divinedragonbox-60914-1475824445361-0:1) is starting INFO | Listening for
connections at: tcp://divinedragonbox:15511 INFO | Connector openwire
started INFO | Listening for connections at: stomp://divinedragonbox:15512
INFO | Connector stomp started INFO | Listening for connections at:
ssl://divinedragonbox:15571 INFO | Connector ssl started INFO | Establishing
network connection from vm://divinedragonbox?async=false=true to
ssl://localhost:15571 INFO | Connector vm://divinedragonbox started INFO |
Network Connector DiscoveryNetworkConnector:host1 and
host2:BrokerService[divinedragonbox] started INFO | Apache ActiveMQ 5.11.1
(divinedragonbox, ID:divinedragonbox-60914-1475824445361-0:1) started INFO |
For help or more information please see: http://activemq.apache.org INFO |
divinedragonbox Shutting down INFO | Connector vm://divinedragonbox stopped
INFO | divinedragonbox bridge to Unknown stopped WARN | Transport Connection
to: tcp://127.0.0.1:40890 failed: java.io.EOFException INFO | ActiveMQ
WebConsole available at http://localhost:15521/ INFO | Initializing Spring
FrameworkServlet 'dispatcher' INFO | jolokia-agent: No access restrictor
found at classpath:/jolokia-access.xml, access to all MBeans is allowed
I enabled the TRACE for the messages and I got the following snippets of
exceptions in the log file.
2016-10-07 08:15:45,378 | TRACE | Execute[ActiveMQ ForwardingBridge
StopTask] runnable:
org.apache.activemq.network.DemandForwardingBridgeSupport$4@b3f451d |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,378 | TRACE |
Created and running thread[ActiveMQ ForwardingBridge StopTask-5]:
Thread[ActiveMQ ForwardingBridge StopTask-5,5,main] |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,379 | DEBUG |
Caught exception sending shutdown |
org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ
ForwardingBridge
StopTask-5org.apache.activemq.transport.TransportDisposedIOException:
Transport disposed. at
org.apache.activemq.transport.vm.VMTransport.oneway(
VMTransport.java:82)[activemq-broker-5.11.1.jar:5.11.1]
at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)[
activemq-client-5.11.1.jar:5.11.1]
at
org.apache.activemq.transport.ResponseCorrelator.oneway(
ResponseCorrelator.java:60)[activemq-client-5.11.1.jar:5.11.1]
at
org.apache.activemq.network.DemandForwardingBridgeSupport$4.run(
DemandForwardingBridgeSupport.java:288)[activemq-broker-5.11.1.jar:5.11.1]
at java.lang.Thread.run(Thread.java:722)[:1.7.0_05]2016-10-07 08:15:45,380 |
DEBUG | Stopping transport ssl://localhost/127.0.0.1:15571 |
org.apache.activemq.transport.tcp.TcpTransport | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,381 | DEBUG |
Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: null |

Re: ActiveMQ REST message listener

2016-10-07 Thread Tim Bain
I'd also be curious to hear more about "I don't want to use the tcp
connection as it will be closed," since that seems to be driving your
requirements but doesn't make sense to me as stated.

Tim

On Oct 7, 2016 3:40 AM, "Martyn Taylor"  wrote:

The REST over HTTP pattern is request/response you send a GET request and
you "get" a response.  By it's very nature is going to require polling.
I'm not sure what your requirements are, but if you are trying to do this
stuff in a browser, then using Websockets as John suggested could get you
what you need.  Apache Artemis also supports MQTT and AMQP protocols over
Websockets.

Can you elaborate a little on what it is you're attempting to do?

On Fri, Oct 7, 2016 at 12:37 AM, John D. Ament 
wrote:

> Hi,
>
> It sounds like your requirements are limiting what you can do.
>
> Can you consider the websocket approach as well? Its still over HTTP, but
> reduces the request/response pattern into a persistent connection.
>
> http://activemq.apache.org/websockets.html
>
> https://activemq.apache.org/artemis/docs/1.4.0/protocols-
> interoperability.html
> if
> you're using Artemis (see the section, Stomp over Web Sockers)
>
> John
>
> On Thu, Oct 6, 2016 at 12:07 PM ruiwp13  wrote:
>
> > Hello,
> >
> > I want to get messages from a topic through a get method. The problem is
> > that I want to get those messages once they are sent to the topic
meaning
> > that I have to be constantly polling the method in order to get the
> > messages. Is there any other way to have a message listener? I don't
want
> > to
> > use the tcp connection as it will be closed. The REST API is the only
> thing
> > that will be available to users.
> >
> > Best Regards
> >
> > Rui Neves
> >
> >
> >
> > --
> > View this message in context:
> > http://activemq.2283324.n4.nabble.com/ActiveMQ-REST-
> message-listener-tp4717553.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>


Re: Messaging listener for local messages only

2016-10-07 Thread Martyn Taylor
I'd start with Justin's suggestions, if those are not possible it might be
possible add an outbound interceptor that increments a message property
with a counter "NUMBER_OF_HOPS".  It would get triggered every time the
message is forwarded to a broker or client.  This way you can figure out
how many hops the messages has had.  1 means local broker, >1 means a
remote broker.





On Thu, Sep 29, 2016 at 2:23 PM, Justin Bertram  wrote:

> I see a couple of options off the top of my head:
>
>   1) Make sure "messages sent via the local broker" have a unique,
> consistent property and simply create your topic subscription to select
> those messages.
>
>   2) Modify your cluster-connection configuration so that the topic in
> question isn't clustered.
>
>
> Justin
>
> - Original Message -
> From: "Lachezar Dobrev" 
> To: users@activemq.apache.org
> Sent: Thursday, September 29, 2016 6:35:18 AM
> Subject: Messaging listener for local messages only
>
>   I have a multi-node (static) network of embedded Artemis JMS brokers.
>   I'm wondering if there is a way to register a JMS listener to a topic,
> but somehow distinguish between messages sent via the local broker and
> those that come from different nodes in the 'cluster'?
>   I'd like to make sure, that the specific listener only handles messages
> sent from producers connected to the same broker.
>


Re: Duplicating messages published to a Topic to a Queue

2016-10-07 Thread Martyn Taylor
I don't have enough information to understand you problem fully.  But
perhaps you could use a combination of duplicate detection and diverts
could solve your problem.

https://activemq.apache.org/artemis/docs/1.4.0/duplicate-detection.htm
https://activemq.apache.org/artemis/docs/1.4.0/diverts.html

Cheers
Martyn



On Mon, Oct 3, 2016 at 2:54 PM, Lachezar Dobrev  wrote:

>   Hello all,
>
>   I have a design problem: a topic is clustered in a network of brokers to
> allow multiple nodes to handle events occurring in other nodes: i.e. a user
> logs in on one node, but all nodes *might* need to know that.
>   A new requirement has surfaced, that copies of these messages need to be
> sent to an external system (not a messaging system). The trivial solution
> is to add a new subscriber to the Topic that handles the delivery, but
> since this is a distributed system of equivalent nodes that ends up sending
> the message multiple times, one per node in the cluster.
>
>   My current solution is to use Springframework's infrastructure (which the
> Application is based on), and override the JMSTemplate with a custom one
> that sends a copy of every message sent to the Topic to a special Queue
> that the deliverer is handling. This seems to work just fine.
>
>   I'm wondering if there is any out-of-the-box solution to this problem
> provided by Artemis. Like routing/duplication/monitoring that I can turn on
> and get the same (or similar) functionality.
>
>   Lachezar
>


Re: ActiveMQ REST message listener

2016-10-07 Thread Martyn Taylor
The REST over HTTP pattern is request/response you send a GET request and
you "get" a response.  By it's very nature is going to require polling.
I'm not sure what your requirements are, but if you are trying to do this
stuff in a browser, then using Websockets as John suggested could get you
what you need.  Apache Artemis also supports MQTT and AMQP protocols over
Websockets.

Can you elaborate a little on what it is you're attempting to do?

On Fri, Oct 7, 2016 at 12:37 AM, John D. Ament 
wrote:

> Hi,
>
> It sounds like your requirements are limiting what you can do.
>
> Can you consider the websocket approach as well? Its still over HTTP, but
> reduces the request/response pattern into a persistent connection.
>
> http://activemq.apache.org/websockets.html
>
> https://activemq.apache.org/artemis/docs/1.4.0/protocols-
> interoperability.html
> if
> you're using Artemis (see the section, Stomp over Web Sockers)
>
> John
>
> On Thu, Oct 6, 2016 at 12:07 PM ruiwp13  wrote:
>
> > Hello,
> >
> > I want to get messages from a topic through a get method. The problem is
> > that I want to get those messages once they are sent to the topic meaning
> > that I have to be constantly polling the method in order to get the
> > messages. Is there any other way to have a message listener? I don't want
> > to
> > use the tcp connection as it will be closed. The REST API is the only
> thing
> > that will be available to users.
> >
> > Best Regards
> >
> > Rui Neves
> >
> >
> >
> > --
> > View this message in context:
> > http://activemq.2283324.n4.nabble.com/ActiveMQ-REST-
> message-listener-tp4717553.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>


java.io.EOFException when ActiveMQ starts

2016-10-07 Thread divinedragon
I am trying to start the ActiveMQ 5.11 and I see a WARNING as below:
 WARN | Transport Connection to: tcp://127.0.0.1:40890 failed:
java.io.EOFException
Here is the entire console log for this.
Java Runtime: Oracle Corporation 1.7.0_05 /usr/java/jdk1.7.0_05/jre  Heap
sizes: current=1004928k  free=994439k  max=1004928kJVM args: -Xmx1G
-Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties
-Djava.security.auth.login.config=/home/dragon/activemq/conf/login.config
-Dcom.sun.management.jmxremote -Djava.io.tmpdir=/home/dragon/activemq/tmp
-Dactivemq.classpath=/home/dragon/activemq/conf;
-Dactivemq.home=/home/dragon/activemq -Dactivemq.base=/home/dragon/activemq
-Dactivemq.conf=/home/dragon/activemq/conf
-Dactivemq.data=/home/dragon/activemq/dataExtensions classpath: 
[/home/dragon/activemq/lib,/home/dragon/activemq/lib/camel,/home/dragon/activemq/lib/optional,/home/dragon/activemq/lib/web,/home/dragon/activemq/lib/extra]ACTIVEMQ_HOME:
/home/dragon/activemqACTIVEMQ_BASE: /home/dragon/activemqACTIVEMQ_CONF:
/home/dragon/activemq/confACTIVEMQ_DATA: /home/dragon/activemq/dataLoading
message broker from: xbean:activemq.xml INFO | Refreshing
org.apache.activemq.xbean.XBeanBrokerFactory$1@a842913: startup date [Fri
Oct 07 08:14:02 IST 2016]; root of context hierarchy INFO |
PListStore:[/home/dragon/activemq/data/divinedragonbox/tmp_storage] started
INFO | Using Persistence Adapter:
KahaDBPersistenceAdapter[/home/dragon/jms_store] INFO | JMX consoles can
connect to service:jmx:rmi:///jndi/rmi://localhost:15526/jmxrmi INFO |
KahaDB is version 5 INFO | Recovering from the journal ... INFO | Recovery
replayed 76 operations from the journal in 0.032 seconds. INFO | Apache
ActiveMQ 5.11.1 (divinedragonbox,
ID:divinedragonbox-60914-1475824445361-0:1) is starting INFO | Listening for
connections at: tcp://divinedragonbox:15511 INFO | Connector openwire
started INFO | Listening for connections at: stomp://divinedragonbox:15512
INFO | Connector stomp started INFO | Listening for connections at:
ssl://divinedragonbox:15571 INFO | Connector ssl started INFO | Establishing
network connection from vm://divinedragonbox?async=false=true to
ssl://localhost:15571 INFO | Connector vm://divinedragonbox started INFO |
Network Connector DiscoveryNetworkConnector:host1 and
host2:BrokerService[divinedragonbox] started INFO | Apache ActiveMQ 5.11.1
(divinedragonbox, ID:divinedragonbox-60914-1475824445361-0:1) started INFO |
For help or more information please see: http://activemq.apache.org INFO |
divinedragonbox Shutting down INFO | Connector vm://divinedragonbox stopped
INFO | divinedragonbox bridge to Unknown stopped WARN | Transport Connection
to: tcp://127.0.0.1:40890 failed: java.io.EOFException INFO | ActiveMQ
WebConsole available at http://localhost:15521/ INFO | Initializing Spring
FrameworkServlet 'dispatcher' INFO | jolokia-agent: No access restrictor
found at classpath:/jolokia-access.xml, access to all MBeans is allowed
I enabled the TRACE for the messages and I got the following snippets of
exceptions in the log file.
2016-10-07 08:15:45,378 | TRACE | Execute[ActiveMQ ForwardingBridge
StopTask] runnable:
org.apache.activemq.network.DemandForwardingBridgeSupport$4@b3f451d |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,378 | TRACE |
Created and running thread[ActiveMQ ForwardingBridge StopTask-5]:
Thread[ActiveMQ ForwardingBridge StopTask-5,5,main] |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,379 | DEBUG |
Caught exception sending shutdown |
org.apache.activemq.network.DemandForwardingBridgeSupport | ActiveMQ
ForwardingBridge
StopTask-5org.apache.activemq.transport.TransportDisposedIOException:
Transport disposed. at
org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:82)[activemq-broker-5.11.1.jar:5.11.1]
at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)[activemq-client-5.11.1.jar:5.11.1]
at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)[activemq-client-5.11.1.jar:5.11.1]
at
org.apache.activemq.network.DemandForwardingBridgeSupport$4.run(DemandForwardingBridgeSupport.java:288)[activemq-broker-5.11.1.jar:5.11.1]
at java.lang.Thread.run(Thread.java:722)[:1.7.0_05]2016-10-07 08:15:45,380 |
DEBUG | Stopping transport ssl://localhost/127.0.0.1:15571 |
org.apache.activemq.transport.tcp.TcpTransport | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,381 | DEBUG |
Initialized TaskRunnerFactory[ActiveMQ Task] using ExecutorService: null |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox] Task-42016-10-07 08:15:45,381 | TRACE |
Execute[ActiveMQ Task] runnable:
org.apache.activemq.transport.tcp.TcpTransport$1@a1848dc |
org.apache.activemq.thread.TaskRunnerFactory | ActiveMQ
BrokerService[divinedragonbox]