From activemq-dev-return-4192-apmail-geronimo-activemq-dev-archive=geronimo.apache.org@geronimo.apache.org Fri Dec 08 19:42:56 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 29297 invoked from network); 8 Dec 2006 19:42:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 19:42:55 -0000 Received: (qmail 15304 invoked by uid 500); 8 Dec 2006 19:43:04 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 15184 invoked by uid 500); 8 Dec 2006 19:43:03 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 15175 invoked by uid 99); 8 Dec 2006 19:43:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 11:43:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [199.105.164.5] (HELO smtpmail2.sensis.com) (199.105.164.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 11:42:52 -0800 Received: from dimstar2.ats.sensis.com ([172.21.1.6]) by smtpmail2.sensis.com with esmtp (Exim 4.50) id 1Gslc7-0003xV-0y for activemq-dev@geronimo.apache.org; Fri, 08 Dec 2006 14:42:31 -0500 Received: from corpatsmail1.ats.sensis.com ([172.21.1.88] helo=corpatsmail1.corp.sensis.com) by dimstar2.ats.sensis.com with esmtp (Exim 4.50) id 1Gslbg-0005yl-Iy for activemq-dev@geronimo.apache.org; Fri, 08 Dec 2006 14:42:04 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: active-cpp persistent problem Date: Fri, 8 Dec 2006 14:42:04 -0500 Message-ID: <5A211522579EBD4A83155ED7FA153063013B634D@corpatsmail1.corp.sensis.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: active-cpp persistent problem Thread-Index: AccbAHZC8fwb6DROQzCawek5b+sfAQAAGcxQ From: "Bish, Tim" To: X-Sensis-MailScanner-Information: Scanned at Sensis Corporation by MailScanner X-Sensis-MailScanner: Found to be clean X-Sensis-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=-4.322, required 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60, TW_JC 0.08) X-Sensis-MailScanner-From: tim.bish@sensis.com X-Virus-Checked: Checked by ClamAV on apache.org What version of the broker are you using? Regards=20 Tim > -----Original Message----- > From: amq user [mailto:amq.user@gmail.com] > Sent: Friday, December 08, 2006 2:37 PM > To: activemq-dev@geronimo.apache.org > Subject: Re: active-cpp persistent problem >=20 > On 12/8/06, Bish, Tim wrote: > > > > > > AFAIK the activemq-cpp message do properly send the persistant flag. > > > > Can you create a small test app that demonstrates to problem? >=20 >=20 > yes. my test code is just a copy of main.cpp from the example. >=20 > run method looks like: >=20 > virtual void run() { > try { > // Open test message file > FILE *fd; > if ( (fd =3D fopen(messageFile.c_str(), "r")) =3D=3D NULL) = { > cout<<"Error: Can't open file: "< return; > } >=20 > ActiveMQConnectionFactory* connectionFactory =3D new > ActiveMQConnectionFactory("tcp://10.111.53.230:22222"); > // Create a Connection > connection =3D connectionFactory->createConnection(); > connection->start(); > // Create a Session > session =3D connection->createSession( Session::AUTO_ACKNOWLEDGE > ); >=20 > // Create the destination (Topic or Queue) > destination =3D session->createQueue( "TEST.FOO" ); >=20 > // Create a MessageProducer from the Session to the Topic or > Queue > producer =3D session->createProducer( destination ); > producer->setDeliveryMode( DeliveryMode::PERSISTANT ); >=20 > // Create the Thread Id String > string threadIdStr =3D Integer::toString( Thread::getId() = ); >=20 > // Create a messages > string texts =3D (string)""; > string texte =3D (string)""; > TextMessage* message_s =3D session->createTextMessage( > string(texts) ); >=20 > producer->send( message_s ); > delete message_s; >=20 > char * line =3D NULL; > size_t len =3D 0; > ssize_t read; > for( int ix=3D0; ix fseek(fd,0L,SEEK_SET); > while((read =3D getline(&line,&len,fd)) !=3D -1) { > //TextMessage* message =3D session->createTextMessage( text > ); > TextMessage* message =3D session->createTextMessage( > string(line) ); >=20 > // Tell the producer to send the message > //printf( "Sent message from thread %s\n", > threadIdStr.c_str() > ); > producer->send( message ); >=20 > delete message; > } > } >=20 > TextMessage* message_e =3D session->createTextMessage( > string(texte) ); > producer->send( message_e ); > delete message_e; >=20 > if(line) > free(line); >=20 > }catch ( CMSException& e ) { > e.printStackTrace(); > } > } >=20 >=20 >=20 >=20 > What are the steps you are currently following in both cases? Are you > > sending messages with the C++ client and they are not persistant when > > you restart and connect a C++ client back to the broker, or have you > > tried sending a message persistantly with C++ and then connecting back > > with a Java client to see if that gets the messages that should have > > been persisted? >=20 >=20 > I used the cpp code above to send some messages. And they are gone after I > restart the broker. I tried to use cpp consumer to get those messages. > Actually, I don't need to restart the message to see if it is consistent > or > not. If i send enough message to the broker, jconsole says > MemoryPercentageUsed: 100. and I got this: > activemq::io::SocketOutputStream::write - Resource temporarily unavailable > - > tid: 3085880224 > FILE: activemq/network/SocketOutputStream.cpp, LINE: 85 - tid: > 3085880224 > FILE: activemq/connector/stomp/StompCommandWriter.cpp, LINE: 101 - > tid: 3085880224 > FILE: ./activemq/transport/ResponseCorrelator.h, LINE: 163 - tid: > 3085880224 > caught unknown exception - tid: 3085880224 > FILE: activemq/connector/stomp/StompConnector.cpp, LINE: 466 - > tid: > 3085880224 > FILE: activemq/core/ActiveMQSession.cpp, LINE: 495 - tid: > 3085880224 > FILE: activemq/core/ActiveMQProducer.cpp, LINE: 89 - tid: > 3085880224 > FILE: activemq/core/ActiveMQProducer.cpp, LINE: 71 - tid: > 3085880224 > caught unknown exception > FILE: activemq/connector/stomp/StompConnector.cpp, LINE: 466 > FILE: activemq/core/ActiveMQSession.cpp, LINE: 495 > FILE: activemq/core/ActiveMQProducer.cpp, LINE: 89 > FILE: activemq/core/ActiveMQProducer.cpp, LINE: 71 >=20 > Thanks >=20 >=20 >=20 >=20 >=20 > Regards > > > > Tim. > > > > > -----Original Message----- > > > From: amq user [mailto:amq.user@gmail.com] > > > Sent: Friday, December 08, 2006 2:10 PM > > > To: activemq-dev > > > Subject: active-cpp persistent problem > > > > > > I'm struggling with persistent option in activemq-cpp client. (my java > > > client does the trick) > > > part of my code looks like: > > > > > > producer->setDeliveryMode( DeliveryMode::PERSISTANT ); > > > > > > The problem is after I send a message, and stop the broker. The > > message is > > > gone. > > > If I send a lot of message exceeding the memory size the broker > > handles, I > > > got resource unavailable exception. > > > > > > It looks to me the message I send over using cpp doesn't instruct the > > > broker > > > to use persistent. > > > I'm using ActiveMQ 4.0.2, and activemq-cpp-1.0. > > > > > > Please help. What else should I check. Did I miss anything? > > > Thanks > >