Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 58905 invoked from network); 8 Dec 2006 20:35:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 20:35:45 -0000 Received: (qmail 55076 invoked by uid 500); 8 Dec 2006 20:35:43 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 55058 invoked by uid 500); 8 Dec 2006 20:35:42 -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 54985 invoked by uid 99); 8 Dec 2006 20:35:42 -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 12:35:42 -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 66.249.82.236 as permitted sender) Received: from [66.249.82.236] (HELO wx-out-0506.google.com) (66.249.82.236) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 12:35:31 -0800 Received: by wx-out-0506.google.com with SMTP id s18so844495wxc for ; Fri, 08 Dec 2006 12:35:10 -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=LOTeLh/v0ghY+hxrh/8TFYOHTC5lgepwsYiycuOWGxwMv50BAgXEMx7lQzAN6QAZfjKigaEiFqmxAogxG634n9BHZmGDlKjKpoLtEVrjGYK9qmnOOKi/PX8wIPhyJeFWpOyAqQ2myMxqUmCEZNPyCNlt7t0dX93d7xj1CPtWkbI= Received: by 10.90.78.9 with SMTP id a9mr4737597agb.1165610110151; Fri, 08 Dec 2006 12:35:10 -0800 (PST) Received: by 10.90.97.13 with HTTP; Fri, 8 Dec 2006 12:35:10 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2006 15:35:10 -0500 From: "amq user" To: activemq-dev@geronimo.apache.org Subject: Re: active-cpp persistent problem In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_56863_35473.1165610110013" References: <5A211522579EBD4A83155ED7FA153063013B634D@corpatsmail1.corp.sensis.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_56863_35473.1165610110013 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I do see the message is "NON-PERSISTENT" from jconsole using browse(). No matter how I set it (persistent or non-persisten) in the cpp code. I got "NON_PERSISTENT". Please help! On 12/8/06, amq user wrote: > > 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 < Tim.Bish@sensis.com> 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_56863_35473.1165610110013--