You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "srikanth reddy (JIRA)" <ji...@apache.org> on 2011/07/28 19:27:10 UTC

[jira] [Created] (AMQ-3423) How to reattempt individual message

How to reattempt individual message
-----------------------------------

                 Key: AMQ-3423
                 URL: https://issues.apache.org/jira/browse/AMQ-3423
             Project: ActiveMQ
          Issue Type: Task
         Environment: Linux
            Reporter: srikanth reddy


Hi,

I am implementing ActiveMQ Middleware using point to point .
I am facing this issue from last few days

There are multiple message posted to my activemq and one i start activemq my session starts reading messages.I am using individual message acknowledgement.
i.e  qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);

Once i receive message in my message listener i am sending message to child thread and processing message there and processing is completed i am sending acknowledgement.

But problem here is if any exception comes in middle of my message i want to reattempt for that specific message.

I have tryed session.recover here but its recovering all messages on that session which is wrong

Please look into my message consumer and listener
           Consumer class outline
public  QueueSession session = null;
 
public QueueConnection qConnection = null;
	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);           
 	qConnection = connectionFactory.createQueueConnection();
	session = qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
        QueueReceiver _receiver =
                    session.createReceiver(getTransactionQueue(session));
        _receiver.setMessageListener(getMessageListener());

 	public void onMessage(Message message)  {
		//starting chaild thread etc  
		if(doprocess()){
			session.acknowledge();
		} else {
  			//want to roll back particlur message
		}  
      }

Please help me to resolve this issue

Thanks & Regards
Srikanth Reddy

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQ-3423) How to reattempt individual message

Posted by "Timothy Bish (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-3423.
-----------------------------

    Resolution: Not A Problem
    
> How to reattempt individual message
> -----------------------------------
>
>                 Key: AMQ-3423
>                 URL: https://issues.apache.org/jira/browse/AMQ-3423
>             Project: ActiveMQ
>          Issue Type: Task
>         Environment: Linux
>            Reporter: srikanth reddy
>
> Hi,
> I am implementing ActiveMQ Middleware using point to point .
> I am facing this issue from last few days
> There are multiple message posted to my activemq and one i start activemq my session starts reading messages.I am using individual message acknowledgement.
> i.e  qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
> Once i receive message in my message listener i am sending message to child thread and processing message there and processing is completed i am sending acknowledgement.
> But problem here is if any exception comes in middle of my message i want to reattempt for that specific message.
> I have tryed session.recover here but its recovering all messages on that session which is wrong
> Please look into my message consumer and listener
>            Consumer class outline
> public  QueueSession session = null;
>  
> public QueueConnection qConnection = null;
> 	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);           
>  	qConnection = connectionFactory.createQueueConnection();
> 	session = qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
>         QueueReceiver _receiver =
>                     session.createReceiver(getTransactionQueue(session));
>         _receiver.setMessageListener(getMessageListener());
>  	public void onMessage(Message message)  {
> 		//starting chaild thread etc  
> 		if(doprocess()){
> 			session.acknowledge();
> 		} else {
>   			//want to roll back particlur message
> 		}  
>       }
> Please help me to resolve this issue
> Thanks & Regards
> Srikanth Reddy

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQ-3423) How to reattempt individual message

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-3423.
-----------------------------

    Resolution: Not A Problem

The correct solution here is to use a transaction to rollback the messages.

> How to reattempt individual message
> -----------------------------------
>
>                 Key: AMQ-3423
>                 URL: https://issues.apache.org/jira/browse/AMQ-3423
>             Project: ActiveMQ
>          Issue Type: Task
>         Environment: Linux
>            Reporter: srikanth reddy
>
> Hi,
> I am implementing ActiveMQ Middleware using point to point .
> I am facing this issue from last few days
> There are multiple message posted to my activemq and one i start activemq my session starts reading messages.I am using individual message acknowledgement.
> i.e  qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
> Once i receive message in my message listener i am sending message to child thread and processing message there and processing is completed i am sending acknowledgement.
> But problem here is if any exception comes in middle of my message i want to reattempt for that specific message.
> I have tryed session.recover here but its recovering all messages on that session which is wrong
> Please look into my message consumer and listener
>            Consumer class outline
> public  QueueSession session = null;
>  
> public QueueConnection qConnection = null;
> 	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);           
>  	qConnection = connectionFactory.createQueueConnection();
> 	session = qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
>         QueueReceiver _receiver =
>                     session.createReceiver(getTransactionQueue(session));
>         _receiver.setMessageListener(getMessageListener());
>  	public void onMessage(Message message)  {
> 		//starting chaild thread etc  
> 		if(doprocess()){
> 			session.acknowledge();
> 		} else {
>   			//want to roll back particlur message
> 		}  
>       }
> Please help me to resolve this issue
> Thanks & Regards
> Srikanth Reddy

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (AMQ-3423) How to reattempt individual message

Posted by "srikanth reddy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

srikanth reddy reopened AMQ-3423:
---------------------------------


Hi
Thanks for your replay
if i am using transaction i will not do rollback of single message .in a session if i get 10 messages rollback is called on 10 messages even though i commit for few messages

> How to reattempt individual message
> -----------------------------------
>
>                 Key: AMQ-3423
>                 URL: https://issues.apache.org/jira/browse/AMQ-3423
>             Project: ActiveMQ
>          Issue Type: Task
>         Environment: Linux
>            Reporter: srikanth reddy
>
> Hi,
> I am implementing ActiveMQ Middleware using point to point .
> I am facing this issue from last few days
> There are multiple message posted to my activemq and one i start activemq my session starts reading messages.I am using individual message acknowledgement.
> i.e  qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
> Once i receive message in my message listener i am sending message to child thread and processing message there and processing is completed i am sending acknowledgement.
> But problem here is if any exception comes in middle of my message i want to reattempt for that specific message.
> I have tryed session.recover here but its recovering all messages on that session which is wrong
> Please look into my message consumer and listener
>            Consumer class outline
> public  QueueSession session = null;
>  
> public QueueConnection qConnection = null;
> 	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);           
>  	qConnection = connectionFactory.createQueueConnection();
> 	session = qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
>         QueueReceiver _receiver =
>                     session.createReceiver(getTransactionQueue(session));
>         _receiver.setMessageListener(getMessageListener());
>  	public void onMessage(Message message)  {
> 		//starting chaild thread etc  
> 		if(doprocess()){
> 			session.acknowledge();
> 		} else {
>   			//want to roll back particlur message
> 		}  
>       }
> Please help me to resolve this issue
> Thanks & Regards
> Srikanth Reddy

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3423) How to reattempt individual message

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088271#comment-13088271 ] 

Timothy Bish commented on AMQ-3423:
-----------------------------------

Best way to show the presence of an issue is to create a JUnit test case that demonstrates the problem.  

> How to reattempt individual message
> -----------------------------------
>
>                 Key: AMQ-3423
>                 URL: https://issues.apache.org/jira/browse/AMQ-3423
>             Project: ActiveMQ
>          Issue Type: Task
>         Environment: Linux
>            Reporter: srikanth reddy
>
> Hi,
> I am implementing ActiveMQ Middleware using point to point .
> I am facing this issue from last few days
> There are multiple message posted to my activemq and one i start activemq my session starts reading messages.I am using individual message acknowledgement.
> i.e  qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
> Once i receive message in my message listener i am sending message to child thread and processing message there and processing is completed i am sending acknowledgement.
> But problem here is if any exception comes in middle of my message i want to reattempt for that specific message.
> I have tryed session.recover here but its recovering all messages on that session which is wrong
> Please look into my message consumer and listener
>            Consumer class outline
> public  QueueSession session = null;
>  
> public QueueConnection qConnection = null;
> 	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);           
>  	qConnection = connectionFactory.createQueueConnection();
> 	session = qConnection.createQueueSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
>         QueueReceiver _receiver =
>                     session.createReceiver(getTransactionQueue(session));
>         _receiver.setMessageListener(getMessageListener());
>  	public void onMessage(Message message)  {
> 		//starting chaild thread etc  
> 		if(doprocess()){
> 			session.acknowledge();
> 		} else {
>   			//want to roll back particlur message
> 		}  
>       }
> Please help me to resolve this issue
> Thanks & Regards
> Srikanth Reddy

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira