From activemq-dev-return-4193-apmail-geronimo-activemq-dev-archive=geronimo.apache.org@geronimo.apache.org Fri Dec 08 19:44:24 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 29781 invoked from network); 8 Dec 2006 19:44:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 19:44:23 -0000 Received: (qmail 18226 invoked by uid 500); 8 Dec 2006 19:44:31 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 18210 invoked by uid 500); 8 Dec 2006 19:44:31 -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 18201 invoked by uid 99); 8 Dec 2006 19:44:31 -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:44:31 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of amq.user@gmail.com designates 64.233.184.238 as permitted sender) Received: from [64.233.184.238] (HELO wr-out-0506.google.com) (64.233.184.238) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 11:44:20 -0800 Received: by wr-out-0506.google.com with SMTP id i31so605042wra for ; Fri, 08 Dec 2006 11:43:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=QNSal6h8tElACufnS9lL7dx5qej89sIImp+bhWoWicWYErMRolAUKM6Mx3wKh0IWucT+w8rVm/FK8YFAhu2f3Uy7iO61sl1La64VYG0V/P+THxoH0PgYwEcq+z1GDvP5rFdtWy6MFX8UzOXCJ20idE8WLgsjkj4zjuh4EboRAp4= Received: by 10.90.65.11 with SMTP id n11mr4628351aga.1165607039755; Fri, 08 Dec 2006 11:43:59 -0800 (PST) Received: by 10.90.97.13 with HTTP; Fri, 8 Dec 2006 11:43:59 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2006 14:43:59 -0500 From: "amq user" To: activemq-dev@geronimo.apache.org Subject: Re: active-cpp persistent problem In-Reply-To: <5A211522579EBD4A83155ED7FA153063013B634D@corpatsmail1.corp.sensis.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_56249_2454041.1165607039608" References: <5A211522579EBD4A83155ED7FA153063013B634D@corpatsmail1.corp.sensis.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_56249_2454041.1165607039608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline ActiveMQ 4.0.2 and activemq-cpp-1.0 On 12/8/06, Bish, Tim wrote: > > What version of the broker are you using? > > Regards > > 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 > > > > 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? > > > > > > yes. my test code is just a copy of main.cpp from the example. > > > > run method looks like: > > > > virtual void run() { > > try { > > // Open test message file > > FILE *fd; > > if ( (fd = fopen(messageFile.c_str(), "r")) == NULL) { > > cout<<"Error: Can't open file: "< > return; > > } > > > > ActiveMQConnectionFactory* connectionFactory = new > > ActiveMQConnectionFactory("tcp://10.111.53.230:22222"); > > // Create a Connection > > connection = connectionFactory->createConnection(); > > connection->start(); > > // Create a Session > > session = connection->createSession( > Session::AUTO_ACKNOWLEDGE > > ); > > > > // Create the destination (Topic or Queue) > > destination = session->createQueue( "TEST.FOO" ); > > > > // Create a MessageProducer from the Session to the Topic > or > > Queue > > producer = session->createProducer( destination ); > > producer->setDeliveryMode( DeliveryMode::PERSISTANT ); > > > > // Create the Thread Id String > > string threadIdStr = Integer::toString( Thread::getId() ); > > > > // Create a messages > > string texts = (string)""; > > string texte = (string)""; > > TextMessage* message_s = session->createTextMessage( > > string(texts) ); > > > > producer->send( message_s ); > > delete message_s; > > > > char * line = NULL; > > size_t len = 0; > > ssize_t read; > > for( int ix=0; ix > fseek(fd,0L,SEEK_SET); > > while((read = getline(&line,&len,fd)) != -1) { > > //TextMessage* message = session->createTextMessage( > text > > ); > > TextMessage* message = session->createTextMessage( > > string(line) ); > > > > // Tell the producer to send the message > > //printf( "Sent message from thread %s\n", > > threadIdStr.c_str() > > ); > > producer->send( message ); > > > > delete message; > > } > > } > > > > TextMessage* message_e = session->createTextMessage( > > string(texte) ); > > producer->send( message_e ); > > delete message_e; > > > > if(line) > > free(line); > > > > }catch ( CMSException& e ) { > > e.printStackTrace(); > > } > > } > > > > > > > > > > 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? > > > > > > 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 > > > > Thanks > > > > > > > > > > > > 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 > > > > ------=_Part_56249_2454041.1165607039608--