You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Imagine_David <yh...@163.com> on 2008/10/22 03:17:00 UTC

persistence problems in consumer having java exception

1. a exception occured during consuming message, but activemq did not persist
this message. which mean the messages will lose if java exception occur. 

2. after activemq restart, the message persisted in database will automatic
re-queue. but if this message have error again, activemq will not persist
this message. which mean the message will lose too. 

ps: I use jdbcPersistenceAdapter for persist error message in
spring+activemq environment

-- 
View this message in context: http://www.nabble.com/persistence-problems-in-consumer-having-java-exception-tp20102479p20102479.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: persistence problems in consumer having java exception

Posted by Imagine_David <yh...@163.com>.
i think the main problem is how can i make JMS and JDBC operations in one
transaction.
if the answer is yes. can i solve the problem by using Jenck?


Hans Bausewein wrote:
> 
> Which ActiveMQ version do you use?
> 
> Where does the exception occur?
> 
> During a MessageConsumer.receive() ?
> In that case: what exception do you get?
> 
> 
> If the exception occurred after it was received, the message can only be
> retrieved later if the session was transacted and if the transaction was
> rolled back. See the Spring documentation for that.
> 
> It could help if you increase the log level to DEBUG (and enable log4j
> logging).
> 
> Hans
> 
> 

-- 
View this message in context: http://www.nabble.com/persistence-problems-in-consumer-having-java-exception-tp20102479p20143031.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: persistence problems in consumer having java exception

Posted by Imagine_David <yh...@163.com>.
Thank you for the replied Hans,

i used version 5.1.
it's during MessageConsumer.receive()
just simply have NullPointerException. at first, i got XFireRuntimeException
when i try to visit web service at consumer code by use xfire.
these only one way i can get a persist message at db is i mark a debugging
at consumer code to stop the consumer thread, and i keep running the
producer thread, then i got the persist message. even though, it still won't
persist the first message. which mean after i stop consume 3 message, these
are only 2 message will persist at db.

thank you for the help...

David


Hans Bausewein wrote:
> 
> Which ActiveMQ version do you use?
> 
> Where does the exception occur?
> 
> During a MessageConsumer.receive() ?
> In that case: what exception do you get?
> 
> 
> If the exception occurred after it was received, the message can only be
> retrieved later if the session was transacted and if the transaction was
> rolled back. See the Spring documentation for that.
> 
> It could help if you increase the log level to DEBUG (and enable log4j
> logging).
> 
> Hans
> 
> 

-- 
View this message in context: http://www.nabble.com/persistence-problems-in-consumer-having-java-exception-tp20102479p20131484.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: persistence problems in consumer having java exception

Posted by Hans Bausewein <ha...@comerwell.xs4all.nl>.
Which ActiveMQ version do you use?

Where does the exception occur?

During a MessageConsumer.receive() ?
In that case: what exception do you get?


If the exception occurred after it was received, the message can only be
retrieved later if the session was transacted and if the transaction was
rolled back. See the Spring documentation for that.

It could help if you increase the log level to DEBUG (and enable log4j
logging).

Hans

-- 
View this message in context: http://www.nabble.com/persistence-problems-in-consumer-having-java-exception-tp20102479p20128388.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: persistence problems in consumer having java exception

Posted by Imagine_David <yh...@163.com>.
Am i need to use JDBCMessageStore which activemq provided to persist error
message by myself when the java exception occured?
if the answer is yes, how can i get the instance of JDBCMessageStore? should
i config the activemq as non-persistent server?
i pretty sure i shouldn't persist message by myself. but the problem below i
really can't solve. looking forward the help!!!


Imagine_David wrote:
> 
> 1. a exception occured during consuming message, but activemq did not
> persist this message. which mean the messages will lose if java exception
> occur. 
> 
> 2. after activemq restart, the message persisted in database will
> automatic re-queue. but if this message have error again, activemq will
> not persist this message. which mean the message will lose too. 
> 
> ps: I use jdbcPersistenceAdapter for persist error message in
> spring+activemq environment
> 
> 

-- 
View this message in context: http://www.nabble.com/persistence-problems-in-consumer-having-java-exception-tp20102479p20128191.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.