Re: Simulating loss of broker publisher connectivity
Publishers can't enqueue messages locally without a broker. No broker, no work done. However, it's possible to embed a broker within the producer process, which would then connect to the external broker when available and buffer messages when the connection is broken. But this adds complexity to your configuration and you need to think about what you want to happen when the producer process (and its embedded broker) are stopped. Only go down this path if you need the ability to continue producing messages when a connection to the broker is unavailable; if you don't truly need that, it's not worth the effort you'll put into it. Tim On May 13, 2016 12:30 PM, "Jiri Danek"wrote: On Fri, May 13, 2016 at 9:44 AM, siddutta wrote: > I wish to run an experiment in which the publisher loses connection with > the > broker and then enqueues them in its own queue and then when it regains > connectivity it send s all its queued messages to the broker. How can I I > do > this since if I call close connection, I can no longer send(raises an > exception). A trick that I can think of is to use a network of two brokers > and simulate the above by breaking the connection between the two brokers. > Is there an API call that I can use to do the above? > You could try sending a SIGSTOP signal to the broker process, wait for a while, and then send it a SIGCONT. If the broker is running in a terminal, you can do Ctrl+z to pause it and then fg to resume it. If you do this, connection stays open, but broker stops responding. I believe that from the point of view of the publisher, this is indistinguishable from a network failure between the publisher and the router. -- Jiří Daněk
[Artemis] Issue with static connectors
Hi, We have a setup Artemis broker sits behind SSL offloading hardware. client ---TLS---> VIP(ssl-offload) ---TCP--> Artemis broker We have a HA setup with one master and one broker. I have followed the examples and add two TransportConfigurations one for each. ActiveMQConnectionFactory connectionFactory = ActiveMQJMSClient.createConnectionFactoryWithHA( JMSFactoryType.CF, masterConfig, slaveConfig); Since Artemis client uses by default RoundRobinConnectionLoadBalancingPolicy to pick initial connector and first one is random sometimes its picking slaveConfig to connect. Because we have VIP in front, connection itself is successful all the time even though broker behind it might be down. Naturally connector gets an error while trying to download clusterTopology. When this happens, instead of trying other available connector Artemis client errors out. I think this is wrong behavior. It should try out all available connectors before erroring out. Please let me know if I am missing something here or any comments or thoughts are welcome. Exception in thread "main" javax.jms.JMSRuntimeException: Failed to create session factory at org.apache.activemq.artemis.jms.client.JmsExceptionUtils.convertToRuntimeException(JmsExceptionUtils.java:88) at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createContext(ActiveMQConnectionFactory.java:267) at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createContext(ActiveMQConnectionFactory.java:253) at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createContext(ActiveMQConnectionFactory.java:243) at com.abhiz.artemis.QueueExample.main(QueueExample.java:47) Caused by: javax.jms.JMSException: Failed to create session factory at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:735) at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createContext(ActiveMQConnectionFactory.java:260) ... 3 more Caused by: ActiveMQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=AMQ119013: Timed out waiting to receive cluster topology. Group:null] at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:828) at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:732) ... 4 more -- View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Issue-with-static-connectors-tp4711907.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Simulating loss of broker publisher connectivity
On Fri, May 13, 2016 at 9:44 AM, sidduttawrote: > I wish to run an experiment in which the publisher loses connection with > the > broker and then enqueues them in its own queue and then when it regains > connectivity it send s all its queued messages to the broker. How can I I > do > this since if I call close connection, I can no longer send(raises an > exception). A trick that I can think of is to use a network of two brokers > and simulate the above by breaking the connection between the two brokers. > Is there an API call that I can use to do the above? > You could try sending a SIGSTOP signal to the broker process, wait for a while, and then send it a SIGCONT. If the broker is running in a terminal, you can do Ctrl+z to pause it and then fg to resume it. If you do this, connection stays open, but broker stops responding. I believe that from the point of view of the publisher, this is indistinguishable from a network failure between the publisher and the router. -- Jiří Daněk
How can i get Broker Service instance of the remote broker ?
I have a use case where i have to get the broker service instance for the remote broker or getting the remote broker instance. I have tried in creating broker service instance and adding the remote connector uri address but thats not helping me to get the region broker and i am in need of region broker . Please suggest or throw up some snippets which relates to the remote broker service instance and remote region broker instance. -- View this message in context: http://activemq.2283324.n4.nabble.com/How-can-i-get-Broker-Service-instance-of-the-remote-broker-tp4711891.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Artemis - Duplicate message detected - message will not be routed.
Hi, I am trying to run transaction failover test which is present below on my local server cluster https://github.com/apache/activemq-artemis/blob/master/examples/features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java As I read the documentation I do not have to do anything in broker.xml. But I am getting an error when it tries to commit second time on the backup. Am I missing any configuration here? Exception in thread "main" javax.jms.JMSException: Duplicate message detected - message will not be routed. Message information:ServerMessage[messageID=64,durable=true,userID=c17404b9-188d-11e6-a620-2e54f7ea8757,priority=4, bodySize=281, timestamp=Thu May 12 18:06:19 EDT 2016,expiration=0, durable=true, address=jms.queue.exampleQueue,properties=TypedProperties[_AMQ_DUPL_ID=14630907630599,__AMQ_CID=bdcf1883-188d-11e6-a620-2e54f7ea8757]]@1256539883 at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:376) at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.simpleCommit(ActiveMQSessionContext.java:301) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.commit(ClientSessionImpl.java:509) at org.apache.activemq.artemis.core.client.impl.DelegatingSession.commit(DelegatingSession.java:161) at org.apache.activemq.artemis.jms.client.ActiveMQSession.commit(ActiveMQSession.java:213) at TransactionFailoverExample.main(TransactionFailoverExample.java:114) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Thanks Abhi -- View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Duplicate-message-detected-message-will-not-be-routed-tp4711878.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
[Artemis] Set allowed SASL mechanisms
Hi, I am trying to restrict SASL mechanisms. I could not find how to do it in documentation. Is it possible to restrict SASL mechanisms for instance to EXTERNAL only? Vavricka -- View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Set-allowed-SASL-mechanisms-tp4711889.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.