activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pfid ...@informationsdesign.de>
Subject CMS: message redelivery question / producer causing segmentation fault
Date Wed, 28 Nov 2007 11:40:02 GMT

I'm having 2 problems with activemq-cpp-2.1.1 i just cant get rid off.
hopefully someone can help me out :) the broker i'm using is v4.1.1.

1) how does message redelivery work with the activemq-cpp-2.1.1 api?
according to
http://activemq.apache.org/message-redelivery-and-dlq-handling.html i need
to use commit(), rollback() or recover(). 
in my client app i'm using Session::CLIENT_ACKNOWLEDGE as well as
DeliveryMode::PERSISTENT. in my client app i don't want to acknowledge any
message i read, since this is supposed to be a check, only to see whats in
the queue, and don't take it off the queue. so i
1) open the queue (as showed in the example code) and start reading
2) print messages to console
3) don't acknowledge any message
4) program ends

all goes fine so far. but, however, when i try to do the same thing again,
my client won't receive any message. i can restart the programas much as i
want, it wont let me read the messages that are still in the queue. only
when i send at least one more message to this queue (from any application),
my app will read ALL messages (the previous received ones plus the
additional "trigger"-message) again just fine. any more tries will again
result in not receving any messages.

i could not find the above mentioned method session::recover() (its not in
Session.h), so i wonder how i could get the messages redelivered? note that
the application will terminate when it finished reading (its just a
queue-check program), thus all activemq objects will be rebuild/opened when
i restart the application.


2) for this case i'm using the example code showed on the amq-cpp-2.1.1
website. i've only changed
- use queues
- name of the queue
- add username/password to connectionfactory

the broker is configured with a couple of queues like this:


                <plugins>
>                         <jaasAuthenticationPlugin
> configuration="activemq-domain"/>
>                         <authorizationPlugin>
>                                 <map>
>                                         <authorizationMap>
>                                                 <authorizationEntries>
>                                                    <authorizationEntry
> queue="test_in" read="admin" write="testuser" admin="testuser,admin"/>
>                                                    <authorizationEntry
> queue="test_out" read="testuser" write="admin" admin="testuser,admin"/>
> 
> groups.properties: 
> admins=admin
> testuser=testuser
> 
> users.properties
> admin=adminpwd
> testuser=testpwd

test 1: producer writes queue "test_in" with username "testuser" and
appropriate password. works.
test 2: consumer reads queue "test_in" with username "testuser" and
appropriate password. Error: "User testuser is not authorized to read from:
queue://test_in". This is fine.

test 3: consumer reads queue "test_out" with username "testuser" and
appropriate password. works.
test 4: producer writes queue "test_out" with username "testuser" and
appropriate password. Segmentation fault (core dumped).
Backtrace:


> #0  0x080e6d07 in
> activemq::connector::openwire::OpenWireConnector::createProducer
> (this=0x829ca78, destination=0x829c8c0, session=0x829cbd8)
>     at activemq/connector/openwire/OpenWireConnector.cpp:678
> 678             delete producerInfo;
> #0  0x080e6d07 in
> activemq::connector::openwire::OpenWireConnector::createProducer
> (this=0x829ca78, destination=0x829c8c0, session=0x829cbd8)
>     at activemq/connector/openwire/OpenWireConnector.cpp:678
> #1  0x080a64c3 in activemq::core::ActiveMQSession::createProducer
> (this=0x829c928, destination=0xb74b9678) at
> activemq/core/ActiveMQSession.cpp:348
> 
Could someone help me please?
-- 
View this message in context: http://www.nabble.com/CMS%3A-message-redelivery-question---producer-causing-segmentation-fault-tf4887950s2354.html#a13990648
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message