activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Giacomini (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQCPP-531) receiveNoWait never returns
Date Tue, 28 Jan 2014 14:20:40 GMT

    [ https://issues.apache.org/jira/browse/AMQCPP-531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13884171#comment-13884171
] 

Vincent Giacomini commented on AMQCPP-531:
------------------------------------------

Just saw the "DothrowV6" method in stack trace and so I've just modified my piece of code
to print exception in a catch block and this give the following message :
Cannot synchronously receive a message when a MessageListener is set

Don't understand why it talks to me about a listener while I didn't set one in my code :

	// créer un consommateur général
	std::auto_ptr<cms::MessageConsumer> consumer(session->createConsumer(serviceQueue))
;
	std::stringstream ss ;
	// crée un selecteur pour une message de vie pour ce processus
	// exemple de selecteur ==> JMSType = 'aliveMsg' AND dest = '1'
	ss << "JMSType = '" << msi::constant::process::alive_Rq_msgtype << "' AND
" << msi::constant::process::dest_alive_msgprop << " = '" << server.getId()
<< "'" ;
	LOG4CXX_INFO(logger,"selecteur message de vie = " << ss.str()) ;

	// créé un consommateur pour les messages de vie
	std::auto_ptr<cms::MessageConsumer> aliveConsumer(session->createConsumer(serviceQueue,ss.str()))
;

	LOG4CXX_INFO(logger, "service prêt") ;
	do
    {
		try
		{
		  // Récupération prioritaire des messages de vie
		  message = aliveConsumer->receiveNoWait() ;

		  // si pas de message de vue, on se met en attente d'un autre type de message
		  if (message == NULL)
		  {
			  // récupère un message de la file d'attente (bloque si celle-ci est vide)
			  message = consumer->receive(msi::constant::system::maxMessageWait) ;
		  }
		  // si un message est a traiter
          if (message != NULL)
          {
			  LOG4CXX_DEBUG(logger,"Reception message n°" << message->getCMSCorrelationID()
<< " de type " << message->getCMSType()) ;

				  processMessage(message) ;

	          // liberation des ressources
	          delete message ;
         }
		}
		  catch (std::exception& e)
		  {
		    std::cout << "Standard exception: " << e.what() << std::endl;
		  }

    } while(!_exitRequested) ;

> receiveNoWait never returns
> ---------------------------
>
>                 Key: AMQCPP-531
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-531
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 3.8.2
>         Environment: AIX 6.1
> Compilateur XLC V12
> ActiveMQ-cpp buit with the following options : -qminimaltoc -q64 -qrtti=all 
>            Reporter: Vincent Giacomini
>            Assignee: Timothy Bish
>
> Just built the last version 3.8.2 of activemq-cpp (SSL disabled)
> But my application doesn't work anymore. 
> The reason : the consumer->ReceiveNoWait() method now never returns 
> Works well in activemq-cpp 3.4.1....



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message