Re: ActiveMQ – “Master/Slave” configuration with failover protocol

2016-09-26 Thread Tim Bain
You need to give the batch file a task (start, stop, restart, etc.) as an
argument.

Tim

On Sep 26, 2016 9:06 AM, "mathewvino"  wrote:

> Hi there
>
> i am trying with latest version of  apache-activemq-5.14.0  to do the
> Master/Slave failover
>
> Use the below tutorial which is straight forward which is on 5.8.0
>
> https://www.javacodegeeks.com/2014/04/using-activemq-
> masterslave-configuration-with-failover-protocol.html
>
> Following steps did
>
> 1) activemq-admin create ..\cluster\broker-1
> 2)activemq-admin create ..\cluster\broker-2
> 3) broker-1.bat in C:\apache-activemq-5.8.0\cluster\broker-1\bin directory
> --- make changes to
> set ACTIVEMQ_HOME=”C:/apache-activemq-5.8.0″
> set ACTIVEMQ_BASE=”C:/apache-activemq-5.8.0/cluster/broker-1″
> set ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
> 4) activemq.xml for broker-1 to enable JMX monitoring, notice useJMX=”true”
> attribute below.
> 5) 
>
> 6)run broker-1.bat
>
> but i am getting the following error not sure what it is ..
>
> Task Options (Options specific to each task):
> --extdir   - Add the jar files in the directory to the classpath.
> --version   - Display the version information.
> -h,-?,--help- Display this help information. To display task
> specific he
> lp, use Main [task] -h,-?,--help
>
> Task Data:
> - Information needed by each specific task.
>
> JMX system property options:
> -Dactivemq.jmx.url= (default is:
> 'service:jmx:rmi:///jndi/r
> mi://localhost:1099/jmxrmi')
> -Dactivemq.jmx.user=
> -Dactivemq.jmx.password=
>
> Any help is really appreciated
> Thanks
> Vinoj
>
> 
>
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-Master-Slave-configuration-with-
> failover-protocol-tp4716886.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


ActiveMQ – “Master/Slave” configuration with failover protocol

2016-09-26 Thread mathewvino
Hi there

i am trying with latest version of  apache-activemq-5.14.0  to do the
Master/Slave failover

Use the below tutorial which is straight forward which is on 5.8.0

https://www.javacodegeeks.com/2014/04/using-activemq-masterslave-configuration-with-failover-protocol.html

Following steps did

1) activemq-admin create ..\cluster\broker-1
2)activemq-admin create ..\cluster\broker-2
3) broker-1.bat in C:\apache-activemq-5.8.0\cluster\broker-1\bin directory
--- make changes to
set ACTIVEMQ_HOME=”C:/apache-activemq-5.8.0″
set ACTIVEMQ_BASE=”C:/apache-activemq-5.8.0/cluster/broker-1″
set ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
4) activemq.xml for broker-1 to enable JMX monitoring, notice useJMX=”true”
attribute below.
5) 

6)run broker-1.bat

but i am getting the following error not sure what it is ..

Task Options (Options specific to each task):
--extdir   - Add the jar files in the directory to the classpath.
--version   - Display the version information.
-h,-?,--help- Display this help information. To display task
specific he
lp, use Main [task] -h,-?,--help

Task Data:
- Information needed by each specific task.

JMX system property options:
-Dactivemq.jmx.url= (default is:
'service:jmx:rmi:///jndi/r
mi://localhost:1099/jmxrmi')
-Dactivemq.jmx.user=
-Dactivemq.jmx.password=

Any help is really appreciated
Thanks
Vinoj

 







--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-Master-Slave-configuration-with-failover-protocol-tp4716886.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jconsole using activemq

2016-09-26 Thread mathewvino
Thanks Steve/Tim

 it works for me. All i did is  add
In the activemq.xml file, add useJmx="true" to the  tag and make
changes to activemq.bat
set ACTIVEMQ_SUNJMX_START= -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.rmi.port=1098
-Djava.rmi.server.hostname=localhost

start the server

start the jconsole : using remote as localhost:1099

Thanks for the help really appreciate that




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/jconsole-using-activemq-tp4716819p4716885.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: "Cannot send, channel has already failed" messages

2016-09-26 Thread fxram
Hi,

I am getting the following error.


 

Let me know.

Thanks
Ram.S




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Cannot-send-channel-has-already-failed-messages-tp4654848p4716873.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Active MQ Shared File System Master Slave with Elastic File System

2016-09-26 Thread wcrowell
Please take a look at the comment I made on:
https://issues.apache.org/jira/browse/AMQ-6441

I may know what the issue is.  The particular client I am working with is
running JDK 7.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Active-MQ-Shared-File-System-Master-Slave-with-Elastic-File-System-tp4715818p4716871.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


activem-admin command is missing in 5.13.0 for linux

2016-09-26 Thread Shipra
Hi,

I have just installed 5.13.0 on my linux machine but i don't see
activemq-admin command. Kindly guide on the same how can I get it.

Thanks & Regards
Shipra



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/activem-admin-command-is-missing-in-5-13-0-for-linux-tp4716870.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: KAHADB clean up old log files

2016-09-26 Thread Johan Carlquist
I will hijack this thread since I have almost the same problem. Log
files the filling up disk and TRACE telling me:
"not removing data file: XXX as contained ack(s) refer to
referenced file: [XXX]"
Running ActiveMQ 5.13.4.

I hacked'n'slashed KahaDBJournalReader (would be great if the source
code could be found somewhere else were collaboration and contribution
where easier…) to work with the current ActiveMQ.
And the output ended up like this:
---
2016-09-26 16:21:27,659 INFO main - -- inflight transactions---
2016-09-26 16:21:27,669 INFO main - adds[1251093], acks[1270663] for: null
2016-09-26 16:21:27,669 INFO main -

2016-09-26 16:21:27,669 INFO main - Persistent destination statistics:
2016-09-26 16:21:27,670 INFO main - 
2016-09-26 16:21:27,672 INFO main - QUEUE: queue1.test: -38136 msgs.
2016-09-26 16:21:27,673 INFO main - QUEUE: queue1.dev: 5883 msgs.
2016-09-26 16:21:27,673 INFO main - QUEUE: ActiveMQ.DLQ: 3 msgs.
2016-09-26 16:21:27,673 INFO main - QUEUE: aliveness-test: -33 msgs.
2016-09-26 16:21:27,674 INFO main - QUEUE: ActiveMQ.DLQ.Queue.queue1.dev: -636 
msgs.
2016-09-26 16:21:27,674 INFO main - QUEUE: ActiveMQ.DLQ.Queue.queue1.test: 907 
msgs.
---

If comparing with the web console the only thing that seems correct is
the amount of messages in ActiveMQ.DLQ.Queue.queue1.test, everything
else seems wrong.

What can I read from this? Are all the negative values indicating that
my KahaDB is corrupt?

Could enableAckCompaction found in 5.14.0 be a solution to this problem?

--
jocar

> On 22 Sep 2016, at 17:40, Steve Hill  wrote:
> 
> Ok, so I hooked up jconsole and looked at the queues, all of the queues were 
> showing zero.  Right underneath the queues there was a section that said 
> "RecoveredXaTransaction".  It had one entry 
> XID_[1096044365_globalId3132362e392e312e3133392e746. There really is 
> not very much more information available in the attributes.  I ended up 
> hitting the heuristicRollback operation and shortly afterwards the old KahaDB 
> files were removed.  Great news!
> 
> I checked the queues afterwards and rolling back the XA transaction did not 
> cause the message to go anywhere.  Does anyone know what this might have been 
> and how to avoid it from occurring in the future?
> 
> Thanks!
> Steve.
> 
> On 9/22/16 9:09 AM, Tim Bain wrote:
>> Apparently you can scratch the "but not impossible" bit from my reply.
>> Thanks Tim, I didn't know it wasn't allowed.
>> 
>> On Sep 22, 2016 7:07 AM, "Tim Bain"  wrote:
>> 
>>> Topics will only hold onto messages if 1) a consumer is currently
>>> connected but hasn't consumed the messages, or 2) a consumer subscribed
>>> durably but is now disconnected.  #1 indicates a slow (or intentionally
>>> misbehaving) consumer, and isn't likely to be a problem over the span of
>>> time you're describing.  It also would result in the messages being
>>> discarded when the broker is restarted, so if you've done a restart and the
>>> files weren't cleaned up, this isn't the problem.  #2 would be unusual for
>>> advisory topic subscriptions, but not impossible (especially since you
>>> apparently had this situation with your mis-created non-advisory topic).
>>> I'd use JConsole (because it gives more detail than the web console) to go
>>> through each queue looking for a non-zero number of messages, and each
>>> topic looking for offline durable subscribers that have unconsumed messages.
>>> 
>>> Alternatively, you all could run the KahaDB file analysis tool (
>>> http://activemq.apache.org/why-do-kahadb-log-files-
>>> remain-after-cleanup.html) with a debugger attached to try to see what
>>> destination has the message(s) that are keeping 980 and 1438 alive.  (You
>>> say that 1328 shouldn't be there, but the log shows that it's there because
>>> it contains acks for messages in 980, so it should be there, at least until
>>> 980 is deleted.)
>>> 
>>> Tim
>>> 
>>> On Sep 22, 2016 6:39 AM, "Steve Hill"  wrote:
>>> 
>>> After the comment about the TOPIC I decided to take a quick look at that
>>> in the web interface (just to make sure nothing had gone awry)  In deed one
>>> of our "queues" had been created as a topic, not sure why as we use the
>>> same code to connect to the queues however once removed most of the data
>>> files vanished.
>>> 
>>> Under the topics there are several activemq.advisory.xyz topics. Could
>>> these be the source of the remaining kahadb log files that still remain?
>>> 
>>> I am now down to three data files that should not be there. (db-980,
>>> db-1329, and db-1438)
>>> 
>>> 
>>> -rw-r--r--. 1 activemq activemq 33554432 Aug  8 14:00 db-980.log
>>> -rw-r--r--. 1 activemq activemq   527645 Sep 19 19:11 db-1329.log
>>> drwxr-xr-x. 5 activemq activemq 4096 Sep 20 14:57 ..
>>> -rw-r--r--. 1 activemq activemq8 Sep 21 13:17 lock
>>> -rw-r--r--. 1 activemq activemq 33553518 Sep 21 21:52 db-1438.log
>>> drwxr-xr-x. 2 

Re: Messaging for temporary connected systems

2016-09-26 Thread Tim Bain
This can be done with ActiveMQ using a hub-and-spoke topology on a network
of brokers.  The spoke brokers should use duplex connections to the hub so
the hub broker doesn't need to enumerate them all.

You can either embed a broker within each client or run standalone brokers
at each spoke location.  The former is simpler to configure, but has the
significant disadvantage that any messages in a client's embedded broker
will either be lost (if the client broker doesn't use a persistent store)
or unavailable until the client reconnects.  If possible, you should use
standalone brokers colocated with your clients, to enable that messages are
delivered as expected.

Tim

On Sep 22, 2016 6:34 AM, "Christian Schneider" 
wrote:

> I am looking for a best practice to communicate between a central system
> and several remote systems that are only connected for certain time periods.
>
> The remote system sends logs to the central system, the central system can
> dispatch batch jobs running on the remote system. The job should send
> regular heart beats and also report failure or success.
>
> The core requirement is that all operations should be asynchronous.
>
> So for example when sending a log event the remote system should not block
> even if the connection to the central system is not available at the time.
> So I am sure that I will need local queueing and some forwarding mechanism.
>
> Can this be done with activemq? How would such a setup look like?
>
> Christian
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


Re: Iterate over non-persistent activemq expired messages in ActiveMQ.Advisory.Expired.Queue

2016-09-26 Thread Tim Bain
>From http://activemq.apache.org/message-redelivery-and-dlq-handling.html:
"By default, ActiveMQ will not place undeliverable non-persistent messages
on the dead-letter queue."  So unless you enable the processNonPersistent
option described in that page, you can't.

If you do enable that option, here's an example of consuming the advisory
messages:
https://github.com/tabish121/ActiveMQ-HowTo/blob/master/advisory-consumer/src/main/java/org/apache/activemq/recipes/AdvisoryConsumerApp.java.
That consumer just gets the original destination, but you can instead
access the originalMessageId property as documented here:
http://activemq.apache.org/advisory-message.html

Tim

On Sep 21, 2016 11:16 PM, "chetansistla"  wrote:

> Hi,
>
> Iam building an application on activemq where iam sending a message from
> producer where my delivery mode is NON_PERSISTENT (*iam not dealing with
> PERSISTENT delivery mode and i know it will be stored in DLQ-which is not
> my
> design*)and have set a time to live for the message using
> producer.setTimeToLive(2000).As the functionality says the message will
> expire in 2 seconds.
>
> I see that the expired messages are enqueued in the
> *ActiveMQ.Advisory.Expired.Queue* in the topic section of activeMQ admin
> console i.e. *http://localhost:8161/admin/topics.jsp.
> *
> My question is how do i *iterate* over the *ActiveMQ.Advisory.Expired.
> Queue*
> so that i can access the *MessageID* of the expired message.Any code
> example
> would be great.
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Iterate-over-non-persistent-activemq-expired-
> messages-in-ActiveMQ-Advisory-Expired-Queue-tp4716777.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: JMS exception during the Failover

2016-09-26 Thread Tim Bain
If you switch your acknowledgement mode to AUTO_ACKNOWLEDGE and comment out
your call to message.acknowledge(), does the behavior change?  Client ack
mode isn't very widely used, so it's possible there's a bug in the
interaction between it and failover.

Also, in your original post, you said that threads were blocked, and
provided a screenshot to illustrate why you thought that.  That thread is
an idle thread in a thread pool, and it's blocked because there's not
enough work to keep all the threads busy, not because anything is wrong or
because ActiveMQ threads are being prevented from running.

Tim

On Sep 21, 2016 10:33 AM, "akhil"  wrote:

> Hi Tim ,
>
> I am sorry that one was the outdated consumer , I have changed it long time
> back and forgot to update the gist. Yes i have tried yourway but the same
> result.
>
> Thanks,
> Akhil.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/JMS-exception-during-the-Failover-tp4716047p4716706.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Active MQ scalability

2016-09-26 Thread tabrezbasha
Hello,

Im new to ActiveMQ and want to know suppose if my current server where
active mq is installed supports 1K messages per sec. Now load gets increase
and its upto 10K per sec. 

1. What needs to be done to handle this much of load ?
2. Is scalability possible in active mq ?
3. If possible then how ?
4. There is a buzzword called Apache Kafka which supports scalability by
just adding nodes to the cluster without interruption.  How does Activemq
differs from Kafka ?
5. Is kafka finally replacing Active mq ?/

Thanks in Advance. 



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Active-MQ-scalability-tp4716915.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: activem-admin command is missing in 5.13.0 for linux

2016-09-26 Thread mlange
Browsing jira I noticed the removal of this component. Didn't dive deeper,
but it's no longer there.
Probably the same things can be done, but in a different way.

What would you like to do? What would you need the activemq-admin command
for?



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/activem-admin-command-is-missing-in-5-13-0-for-linux-tp4716870p4716914.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ ReplicatedLevelDB corruption

2016-09-26 Thread mlange
Gave the system a weekend time to see if it could recover automatically...
alas that's not the case.

However, when I stopped all brokers, changed one of the brokers with
'replicas="1"' (rather than 3); started it (kind of single mode) and started
the other brokers one by one so they could catch up and then stopped them;
restarted the master broker but now the replicas back to 3 and the backup
brokers got started as well... 

Now the brokers are back online in a consistent state. There are some issues
though...

As the broker that is now primary is one that apparently failed earlier
there are now messages on the queues that should've been consumed (I think);
So, is it possible that the brokers try to heal themselves? (with warnings
and errors in the logs, so the administrator knows to validate the
situation; remaining messages that are uncertain in the 'exactly once'
situation should be moved to the DLQ

Going through the logs I noticed a few things; for simplicty I will call the
HA brokers 'broker1, broker2 and broker3' although they're all 'broker1' :-)

I see that broker1 was online and accepting messages when the test started;
However, it missed some zookeeper pings and got demoted to slave. broker2
became the new master. After the test, all brokers got restarted; Raising
the issue, described in my previous post. This morning I "recovered" broker1
(I now realize I should've done this on the last known master: broker2;
alas...) there are now many messages that I _think_ (they're a bit too many
and the test too generic to determine this easily) have been processed
already.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-ReplicatedLevelDB-corruption-tp4716831p4716912.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.