activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Unhandeled exception when producer sending message in free.c at HeapFree after sending large ammount of messages
Date Wed, 02 Apr 2008 11:19:52 GMT

Your best bet is to create a small sample application that can reproduce
this error so that we can debug it.  I've never seen this kind of
behavior from amq-cpp so I don't know yet where it could be failing.  If
you can create a sample app and create a Jira issue and attach your
files I can take a look.

Regards
Tim.

On Wed, 2008-04-02 at 00:44 -0700, narts wrote:
> Iam using ActiveMQ 4.1.1 and ActiveMQ-cpp-2.1.3  on Windows 2003 server
> Enterprise Edition with VC++ 8.0.
>       
>       Iam sending persistent text messsage using Topic to a destination.
> (wireFormat=openwire, transport.useAsyncSend=false, 
> Session::AUTO_ACKNOWLEDGE, DeliveryMode::PERSISTENT ).
> 
> What my requirement is to generate a message by monitoring Windows. And send
> the generated message to ActiveMQ on central server. And keep on monitoring
> Windows.
> I am using the following code to connect to activemq.  
> 
>                // Create a ConnectionFactory
> 		ConnectionFactory* connectionFactory =
> 			ConnectionFactory::createCMSConnectionFactory( brokerURI );
> 
> 		// Create a Connection
> 		connection = connectionFactory->createConnection();
> 		connection->start();
> 
> 		// free the factory, we are done with it.
> 		delete connectionFactory;
> 
> 		// Create a Session
> 		session = connection->createSession( Session::AUTO_ACKNOWLEDGE );
> 
> 		// Create the destination (Topic or Queue)
> 		if( useTopic ) {
> 			destination = session->createTopic( subject );
> 		} else {
> 			destination = session->createQueue( subject );
> 		}
> 
> 		// Create a MessageProducer from the Session to the Topic or Queue
> 		producer = session->createProducer(destination );
> 		if(persistent)
> 			producer->setDeliveryMode( DeliveryMode::PERSISTENT );
> 		else
> 			producer->setDeliveryMode(DeliveryMode::NON_PERSISTENT);
> 
> 		if(timeToLive)
> 		producer->setTimeToLive(timeToLive);
> 
> Then after generating every message, i am instantly sending it to activemq
> using following code
> 
>                 // Create a message
> 		TextMessage* message = session->createTextMessage( sendmessage );
> 		message->setIntProperty( "Integer", 0 );
> 
> 		// Tell the producer to send the message
> 		producer->send( message );
> 
> 		//indicate message sent
> 		msgdelivered = true;
> 
> 		delete message;
> 
> I am able to send aroung 20000 messages succcessfully. But after that it is
> giving the following exception at a call to send() of producer.
>        
>       "Unhandeled exception at 0x7c82823e in myaplication.exe:
> 0xC0000005:Access violation writing location 0x00040ffc."
>       
>       And my application is stopping the execution in free.c at "retval =
> HeapFree(_crtheap, 0, pBlock);".
> 
>       When i run Stackwalker (from CodeProject, Project:
> Memory_and_Exception_Trace, Author: Jochen Kalmbach) for this application it
> is showing stack over flow in ActivemqCpp.  
> 
> Thanks,
> narts
> 


Mime
View raw message