Re: Multiple virtual topics and messages routing to consumers

2016-03-15 Thread Nuno Oliveira
Thank you for the feedback. 

I have created a simple test case for this based on one of the ActiveMQ basic 
examples (attached to this mail - App.java).

I create two producers, one that will send messages to virtual topic 
VirtualTopic.> and another 
one that will send messages to virtual topic VirtualTopic.MIGRATION.

And I create two consumers, one that will consume from queue 
Consumer.ConsumerA.VirtualTopic.> and another 
one that will consume from queue Consumer.ConsumerB.VirtualTopic.MIGRATION.

Sending one message to each virtual topic I would expect something like this:

Consumer 'ConsumerA' received: This message was from topic 'VirtualTopic.>'.
Consumer 'ConsumerB' received: This message was from topic 
'VirtualTopic.MIGRATION'.

But I get something like this (the messages are replicated to all queues):

Consumer 'ConsumerA' received: This message was from topic 'VirtualTopic.>'.
Consumer 'ConsumerB' received: This message was from topic 'VirtualTopic.>'.
Consumer 'ConsumerA' received: This message was from topic 
'VirtualTopic.MIGRATION'.
Consumer 'ConsumerB' received: This message was from topic 
'VirtualTopic.MIGRATION'.

I tested this using the default configuration with ActiveMQ versions 5.9.0 and 
5.13.2.

You told that you were able to get this behavior with a sample. I would be very 
grateful if you could share that sample :)

Regards, 

Le mardi 15 mars 2016 à 13:36 -0600, Quinn Stevenson a écrit :
> Is there a specific reason the default configuration won’t work for you?  
> (Either don’t set anything, or explicitly set the default of
> 
> 
> I tried a simple sample using the defaults, and it seems to accomplish what 
> you’re after.
> 
> > On Mar 14, 2016, at 11:05 AM, Nuno Oliveira 
> >  wrote:
> > 
> >  > prefix="Consumer.*.VirtualTopic."/>
> > > prefix="Consumer.*.VirtualTopic."/>
> 
-- 
==
GeoServer Professional Services from the experts! 
Visit http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:   +39 0584 1660272
mob:   +39  333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono
da considerarsi strettamente riservate. Il loro utilizzo è consentito 
esclusivamente al destinatario del messaggio, per le finalità indicate
nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il 
destinatario, Vi preghiamo cortesemente di darcene notizia via e
-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal 
Vostro sistema. Conservare il messaggio stesso, divulgarlo
anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per 
finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
 
The information in this message and/or attachments, is intended solely for the 
attention and use of
the named addressee(s) and may be confidential or proprietary in nature or 
covered by the provisions of privacy act (Legislative Decree
June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord 
with its purpose, any disclosure, reproduction, copying,
distribution, or either dissemination, either whole or partial, is strictly 
forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact immediately 
the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender does 
not give any warranty or accept liability as the content,
accuracy or completeness of sent messages and accepts no responsibility  for 
changes made after they were sent or for other risks which
arise as a result of e-mail transmission, viruses, etc.
package org.nmco;

import org.apache.activemq.ActiveMQConnectionFactory;

import javax.jms.*;

public class App {

public static void main(String[] args) throws Exception {
thread(new Producer("VirtualTopic.>"), false);
thread(new Producer("VirtualTopic.MIGRATION"), false);
thread(new Consumer("ConsumerA", "VirtualTopic.>"), false);
thread(new Consumer("ConsumerB", "VirtualTopic.MIGRATION"), false);
Thread.sleep(5000);
}

public static void thread(Runnable runnable, boolean daemon) {
Thread brokerThread = new Thread(runnable);
brokerThread.setDaemon(daemon);
brokerThread.start();
}

public static class Producer implements Runnable {

private final String topicName;

public Producer(String topicName) {
this.topicName = topicName;
}

public void run() {
try {

Re: Multiple virtual topics and messages routing to consumers

2016-03-15 Thread Quinn Stevenson
Is there a specific reason the default configuration won’t work for you?  
(Either don’t set anything, or explicitly set the default of 

I tried a simple sample using the defaults, and it seems to accomplish what 
you’re after.

> On Mar 14, 2016, at 11:05 AM, Nuno Oliveira  
> wrote:
> 
>  prefix="Consumer.*.VirtualTopic."/>
> prefix="Consumer.*.VirtualTopic."/>



Re: Leveldb not recovering from failover

2016-03-15 Thread mtod
I think I found the issue it was a typo in the activemq.xml leveldb config.

I setup a new test I'll report back.

Thanks
Mike




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Leveldb-not-recovering-from-failover-tp4709307p4709317.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message not redirected to DLQ when exception thrown by MDB

2016-03-15 Thread artnaseef
OK, since this works in one container (WebLogic) and not another (WildFly) -
my suspicion is with the container handling of the exception.

Turning up the logging on org.apache.activemq.ActiveMQSession to DEBUG on
the JMS client should cause the following to get logged:

* ... Transaction Commit :...
* ... Transaction Rollback, txid: ...

TRACE level logging may provide even more insight.

DEBUG logging on org.apache.activemq.broker.TransactionBroker on the broker
itself may also provide more insight.

Hope this helps.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Message-not-redirected-to-DLQ-when-exception-thrown-by-MDB-tp4709187p4709308.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Leveldb not recovering from failover

2016-03-15 Thread mtod
I have a 3 node cluster on Redhat servers running ActiveMQ version 5.13.2 and
Zookeeper 3.4.8

The system runs without error for days then when I fail it over it will
sometimes will not recover see log segment below.
The strange thing is I’m getting a Connection refused even from the master
connecting to itself.

Does anyone have any idea what might cause this?

Server1
ActiveMQ.log
2016-03-15 11:57:27,756 | WARN  | Store update waiting on 1 replica(s) to
catch up to log position 1268728231.  |
org.apache.activemq.leveldb.replicated.MasterLevelDBStore | ActiveMQ
BrokerService[localhost] Task-24
2016-03-15 11:57:28,757 | WARN  | Store update waiting on 1 replica(s) to
catch up to log position 1268728231.  |
org.apache.activemq.leveldb.replicated.MasterLevelDBStore | ActiveMQ
BrokerService[localhost] Task-24
2016-03-15 11:57:29,758 | WARN  | Store update waiting on 1 replica(s) to
catch up to log position 1268728231.  |
org.apache.activemq.leveldb.replicated.MasterLevelDBStore | ActiveMQ
BrokerService[localhost] Task-24

Server2
ActiveMQ.log
2016-03-15 11:58:27,575 | INFO  | Using the pure java LevelDB
implementation. | org.apache.activemq.leveldb.LevelDBClient |
hawtdispatch-DEFAULT-1
2016-03-15 11:58:27,575 | INFO  | Attaching to master:
tcp://Server2.corp.local:61619 |
org.apache.activemq.leveldb.replicated.SlaveLevelDBStore |
hawtdispatch-DEFAULT-1
2016-03-15 11:58:27,577 | WARN  | Unexpected session error:
java.net.ConnectException: Connection refused |
org.apache.activemq.leveldb.replicated.SlaveLevelDBStore |
hawtdispatch-DEFAULT-1

Server3
ActiveMQ.log
2016-03-15 11:58:27,484 | INFO  | Using the pure java LevelDB
implementation. | org.apache.activemq.leveldb.LevelDBClient |
hawtdispatch-DEFAULT-1
2016-03-15 11:58:27,485 | INFO  | Attaching to master:
tcp://Server2.corp.local:61619 |
org.apache.activemq.leveldb.replicated.SlaveLevelDBStore |
hawtdispatch-DEFAULT-1
2016-03-15 11:58:27,487 | WARN  | Unexpected session error:
java.net.ConnectException: Connection refused |
org.apache.activemq.leveldb.replicated.SlaveLevelDBStore |
hawtdispatch-DEFAULT-1

Thanks
Mike




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Leveldb-not-recovering-from-failover-tp4709307.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message not redirected to DLQ when exception thrown by MDB

2016-03-15 Thread THMayr
To answer this question you may read chapter "13.6.1 Bean-Managed Transaction
Demarcation" of the specification "Enterprise JavaBeans 3.1, Final Release,
November 5, 2009".

Message driven beans with bean-managed transaction demarcation are not
called with an active transaction. The MDB may use the
/javax.transaction.UserTransaction/ to begin, commit or rollback
transactions. And here the section with the bean and container
responsibilities:

/If a message-driven bean instance starts a transaction in a message
listener method or interceptor method, it must commit the transaction before
the message listener method (or all its interceptor methods) returns. The
container must detect the case in which a transaction was started, but not
completed, in a message listener method or interceptor method for the
message listener method, and handle it as follows:
- Log this as an application error to alert the System Administrator.
- Roll back the started transaction.
- Discard the instance of the message-driven bean./

And this is exactly what I do. So there is not active JTA transaction when
the method /onMessage()/ is entered. I start a transaction, commit the
transaction and in case of an exception I rollback the transaction before
the method is left.

Regards Thomas



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Message-not-redirected-to-DLQ-when-exception-thrown-by-MDB-tp4709187p4709287.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message content returns null occasionally from Virtual Topic to the consumer

2016-03-15 Thread Rohit Sonawat
I have also tested in 5.13.2 and issue is still exists.
I have a windows 64 bit environment in which i was also not able to
replicate it but it is replicable in other system that we have, both 32 and
64 bit windows.
Number of messages in which it will replicate is not consistent but it will
eventually replicate
try to process with more messages.



On Tue, Mar 15, 2016 at 6:40 PM christopher.l.shannon [via ActiveMQ] <
ml-node+s2283324n4709298...@n4.nabble.com> wrote:

> I have run this test a few times and it I never get a null message, which
> could just be because there is a race condition that isn't happening for
> me.  Can you test with a later version such as 5.13.2 to see if it still
> happens for you?
>
> On Tue, Mar 15, 2016 at 7:07 AM, Rohit Sonawat <[hidden email]
> >
> wrote:
>
> > Yes I am using default broker configuration
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709292.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709298.html
> To unsubscribe from Message content returns null occasionally from Virtual
> Topic to the consumer, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709300.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Message content returns null occasionally from Virtual Topic to the consumer

2016-03-15 Thread Rohit Sonawat
Yes I am using default broker configuration



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709292.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message content returns null occasionally from Virtual Topic to the consumer

2016-03-15 Thread Christopher Shannon
Are you using a default broker configuration for your test (broker.xml)? If
not, can you post your configuration?

On Tue, Mar 15, 2016 at 2:18 AM, Rohit Sonawat 
wrote:

> Waiting for a reply and i am going to raise a bug in Active MQ 5.12.2.
> My test results show evidence that there is a prominent bug in this version
> when we have too many consumers for the virtual topic.
> attached is the test scenario for the bug
>
> app.log 
> SampleActiveMQ.zip
> 
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709286.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: Message content returns null occasionally from Virtual Topic to the consumer

2016-03-15 Thread Rohit Sonawat
Waiting for a reply and i am going to raise a bug in Active MQ 5.12.2.
My test results show evidence that there is a prominent bug in this version
when we have too many consumers for the virtual topic.
attached is the test scenario for the bug

app.log    
SampleActiveMQ.zip
  
 



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Message-content-returns-null-occasionally-from-Virtual-Topic-to-the-consumer-tp4709151p4709286.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.