Re: Marshalling failure with pending messages.
Hey Thanks James, I tried out reducing the prefetchbuffer size and raising the memory limit of the broker in activemq.xml. It worked. I'd consider using a newer version of both the broker and the C++ client such as 4.0.1 Hearty Regards, Navin -- View this message in context: http://www.nabble.com/Marshalling-failure-with-pending-messages.-tf2177049.html#a6132236 Sent from the ActiveMQ - Dev forum at Nabble.com.
Marshalling failure with pending messages.
Hi all I am working with the binary version of ActiveMQ 4.0 broker and trying out the openwire cpp apis for asynchronous messaging. [https://svn.apache.org/repos/asf/incubator/activemq/tags/activemq-4.0/openw ire-cpp] I had been testing the persistency between a producer and a listener against large number of offline messages. After sending some messages (I tried around 84) to an offline listener, brining back of listener also brings the following ERROR (My listener first reads all the pending messages from the listening queue). However for lesser number of messges it works fine. Also when both listener and producer are on, the working is perfect. ERROR: Received a broker exception: Unmarshal failed; unknown data structure type 46, at /home/nrawat/openwire2/src/main/cpp/activemq/protocol/openwire/OpenWireMa rshaller.cpp line 710 Exiting read loop due to exception: Unmarshal failed; unknown data structure type 46, at /home/nrawat/openwire2/src/main/cpp/activemq/protocol/openwire/OpenWireMa rshaller.cpp line 710 THANKS IN ADVANCE Hearty Regards, Navin
Re: How to create a temporary Queue
Hi James, Thanks for the response, The Destination object doesn't disappear but you will be unable to send messages to it after the client which created it disappears (once the broker detects its gone). Whats the need of keeping it there if it cannot be used again. We're not keeping it there :). The Destination objects are like URL classes; they can be attached to messages or held in client's RAM - the broker can't really go around every JVM and make sure they don't happen to have a reference to a non existent destination lying around there will only mitigate the broker's resources. The broker resources have been removed when the client disconnected. How could be this temporary destination be removed (somewhere it was suggested to use purge(), but I could not find any such function in the openwire cpp APIs I m using.) They are removed automatically when a client disconnects. This FAQ entry might help you understand that a Destination is not the same thing as a broker's resources for queues http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html I went through the link and found it useful to understand my issues well. Thanks and Regards Navin -- View this message in context: http://www.nabble.com/How-to-create-a-temporary-Queue-tf2145190.html#a5942024 Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: How to create a temporary Queue
Hi James, It sounds like your server is sending a response to a client which has already disconnected. It seems the issue about the respond-back consumer not able to see the temporary queue/topic even when its creator sender is in connection has been faced in the past. The issue has been discussed here (I hav managed to get 2 of those) - The initial receiver (reply back server) is hanging on to the message. http://www.nabble.com/Locked-messages-tf2115092.html#a5907342 The message sent to a temp topic is never delivered to consumer. http://www.nabble.com/Flow-control-tf1539523.html#a4208304 What is discussed in the links is exactly my scenario. My receiver also goes into sleep mode (to be restarted again) after receiving the first message. As suggested in the above discussion links, the working becomes fine if regular topics/queues are used which is exactly happening with me. This issue remained unresolved in both the above links. I think this issue has the cardinality to be taken seriously. What do you say James. Thanks in Advance With warm regards, Navin -- View this message in context: http://www.nabble.com/How-to-create-a-temporary-Queue-tf2145190.html#a5944413 Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: How to create a temporary Queue
Hi James, Thanks for the response, * - It has been said that a temporary queue vanishes along with the creating client. But I am getting this unwanted privilge of having it even after my client ends. How it could be possible? The Destination object doesn't disappear but you will be unable to send messages to it after the client which created it disappears (once the broker detects its gone). Whats the need of keeping it there if it cannot be used again. Its presence there will only mitigate the broker's resources. How could be this temporary destination be removed (somewhere it was suggested to use purge(), but I could not find any such function in the openwire cpp APIs I m using.) My implementation needs writing non-persistent (fire and forget) clients - web clients, for which I need queues that gets created and destroyed with every client session. If temporary queue does not disappears, can I think of any other sort of queues (or say a queue implementation) that can be created and destroyed with every client session. * - And then my server's MessageProducer.send(destination, message); statements gives an exception like - INFO Service- Sync error occurred: javax.jms.JMSException: The destination temp-queue://e849faa0-746f-4258-a650-ea04231a1082:1 does not exist. javax.jms.JMSException: The destination temp-queue://e849faa0-746f-4258-a650-ea04231a1082:1 does not exist. at org.apache.activemq.broker.region.AbstractRegion.lookup(AbstractRegion.java:249) See above, the destination cannot be used as the client has disconnected Sorry James, I forget to tell you here that this exception arrived when my client (temp. queue creator) was still there and not disconnected. Please help me understand this behavior. THANKS IN ADVANCE With Regards, Navin -- View this message in context: http://www.nabble.com/How-to-create-a-temporary-Queue-tf2145190.html#a5941347 Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: Queue hogging by a single consumer.
Hi James, Arshad started it here, so I think follow it here only. Thanks for those pseudo directives. I followed those to find out that for once server receives the requests, it does not sends response back to the client. After receiving the first request, the server goes napping. I think you missed session::createProducer at server side, without which it is giving SIGSEGV fault. Correct me? I have done it like this - [..Client side... pIDestinationTqueue = session-createTemporaryQueue() ; consumer = session-createConsumer(Tqueue, JMSCorrelationID = 'butter') ; consumer-setMessageListener( smartify(this) ) ; //sending request reqmessage = session-createBytesMessage() ; reqmessage-setJMSReplyTo(Tqueue); reqmessage-setJMSCorrelationID(butter); reqmessage-writeString(MsgStr) ; producer-send(reqmessage); ] [.Server side . // server side public void onMessage(message) { pstring NCid; pIDestination NDest; NCid = message-getJMSCorrelationID(); NDest = message-getJMSReplyTo(); producer = session-createProducer(NDest) ; reqMessage = session-createBytesMessage() ; reqMessage-setJMSCorrelationID(NCid-c_str() ); reqMessage-writeString(respMSG) ; //respMSG a variable producer-send(NDest ,reqMessage); } ] Am I missing/overdoing anything here? Please guide me error through. THANKS IN ADVANCE Regards, Navin
Re: Queue hogging by a single consumer.
Hi James, Thanks for the response. I achieved the desired behavior for persistent responses and my consumer application requires applicability to non-persistent responses for which I would be trying out your suggestions soon. Queries down there. :) Great James Your suggestion is working. A major hurdle seems solved. A little query down there. Hi James, Thanks for your response. Are you trying to implement request-response with A, B, C making requests on Z and getting the response? Or can A, B, C process any message from Z? Exactly the first case. A, B, C making requests on Z and getting the response from Z I'm not sure if your issue is that say A doesn't see the responses for its request (if thats the case use either 3 queues, use temporary queues for the responses or use a selector and a correlationID on the request response) - or is it that you have a small number of responses from Z and they are being hogged by one consumer - in which case setting a small prefetch and a round robin dispatch policy will fix this. Its that, A doesn't see the responses for its requests made. I would really appreciate if I can get some help stuff on - 1) Creating, destroying and maintaining data in temporary queues. 2) Setting selector and correlationID in messages. Details here http://incubator.apache.org/activemq/how-should-i-implement-request-response-with-jms.html for 1) just call session.createTemporaryQueue() and set that queue on the Message.setJMSReplyTo() property so that services can reply to your temporary queue. They are deleted when A terminates so there's no issue with maintaining data. for 2) just add a JMSCorrelationID() to the request messages you send as requests. You can then use a selector such as JMSCorrelationID = 'abc' on the consumer for responses so that responses are filtered to only return A's results etc I went for this (2nd) one. Even though now a result is obtained, I would like to ask which one approach is more favoured by you. Is it the temporary queues overhead matter that makes 2nd score over 1st? Any other reason please tell. The main difference is, do you want the response to be persistent. e.g. if A dies and comes back again later - do you want it to resume processing old results? In which case use a persistent queue and correlation IDs. If the responses are transient then use a temporary queue so the old messages get discarded by the broker when A dies. You suggested using correlation ID (with persistent queues) for responses to be persistent and I did it with Group ID following the documents - http://incubator.apache.org/activemq/message-groups.html http://incubator.apache.org/activemq/how-do-message-groups-compare-to-selec tors.html What I have done in code is - [..A/B/C Senders... . . . . . . . . . // Consumer part that reads the responses from a persistent queue. consumer = session-createConsumer(queue, JMSXGroupID = 'cheese') ; . . . . . . . . . . . . . . . . . . . . . . . . . . . message-setJMSXGroupID(cheese) ; producer-send(message) ; ] [..Z Consumer Application (OnMessage). . . . . . . . . . pstring NGid; NGid = message-getJMSXGroupID(); . . . . . . . . . . . . . . . . . . reqMessage-setJMSXGroupID(NGid-c_str() ); . . . . . . . . . producer-send(reqMessage); ] Is my approach right? Please correct me. A bit conerned if my approach equally enable my consumer application correctly identify to which remote sender the response is sent? What is the implementation difference between GroupID and CorrelationID? THANKS IN ADVANCE Regards, Navin
Re: Queue hogging by a single consumer.
Hi James, Thanks for the information. I liked your reasoning enough that I am now using CorrelationID in place of GroupID with equal ease. The issue that caused the rising of this mail seems solved for the moment. But, I m facing certain problems using temporary queues for transient responses. Initiating this issue with a new context. See you there :) That sounds fine - it doesn't really matter what header you use as the 'correlation token', you could make up your own header if you wish. Though the reason I said to use JMSCorrelationID was that most well behaving JMS services should always copy the JMSCorrelationID from any incoming message and apply it to the outbound message. So using JMSCorrelationID is more loosely coupled should work with any JMS service. In this case on the client side (A, B, C) there is no real gain in using Message Groups - which are designed to perform sticky load balancing of requests - since you are already using a selector meaning that there will be only 1 consumer of a message so nothing to load balance. You might want to use message groups on the service side of things - the Z - so that you could perform sitcky load balancing if you have a pool of Z consumers. THANKS IN ADVANCE Regards, Navin
Re: Queue hogging by a single consumer.
Hi James, Thanks for your response. Are you trying to implement request-response with A, B, C making requests on Z and getting the response? Or can A, B, C process any message from Z? Exactly the first case. A, B, C making requests on Z and getting the response from Z I'm not sure if your issue is that say A doesn't see the responses for its request (if thats the case use either 3 queues, use temporary queues for the responses or use a selector and a correlationID on the request response) - or is it that you have a small number of responses from Z and they are being hogged by one consumer - in which case setting a small prefetch and a round robin dispatch policy will fix this. Its that, A doesn't see the responses for its requests made. I would really appreciate if I can get some help stuff on - 1) Creating, destroying and maintaining data in temporary queues. 2) Setting selector and correlationID in messages. On 8/17/06, Naveen Rawat [EMAIL PROTECTED] wrote: Hi all :) I am working with the binary version of ActiveMQ 4.0 broker and trying out the openwire cpp apis for asynchronous messaging. [https://svn.apache.org/repos/asf/incubator/activemq/tags/activemq-4.0/openw ire-cpp] I wonder if I m resurrecting the mummies of issues already burnt. I am trying out having 3 consumers A, B and C listening on the same queue. What I am trying to do is - A, B, C sending on Q1, and consuming Z's response on Q2 Consumer Z listening on Q1, responding back on Q2. like this - A/B/CQ1ZQ2A/B/C Listening/responding to a single consumer is working well at present. BUT broker is spoofing up the responses from Z to the simultaneous consumers (either 2 or all three). Response for one consumer (A) is going to any of the other consumer (B/C). Same is happening for other consumers. Being prefetch size preset to 1000, the consumer that first manages session with the broker on a queue is getting all the messages (and if it gets terminated, the following one hogs the all and so on.) . As I m at presently testing, setting prefetch size to less (say 1), even dont solves the purpose as not giving it frequest quick requests (man Vs machine). Moreover as the hogging consumer is reading and acknowledging all the responses, the prefetch size of even 1 is not surpassed. I tried out with no success the way of grid processing of messages (using MessageGroups) as suggested in http://activemq.org/site/how-do-i-preserve-order-of-messages.html Code relevant of this is as follows - [A/B/C producer = session-createProducer(Q1) ; producer-setPersistent(true) ; message = session-createBytesMessage() ; message-setJMSXGroupID(cheese) ; message-writeString(Hello World) ; producer-send(message); .] [ .Z ' s OnMessage(message)... pstring NGid; NGid = message-getJMSXGroupID(); producer = session-createProducer(Q2) ; producer-setPersistent(true) ; reqMessage = session-createBytesMessage() ; reqMessage-setJMSXGroupID(NGid-c_str() ); reqMessage-writeString(R E C E I V E D) ;//response string producer-send(reqMessage); .] Is there anymore needed in the code that I m loosing? I come to know that there are certain issues yet not resolved pertaining to the prefetch buffer initial size. Correct me please. Will manipulation of prefetch buffer size help my cause? Please suggest a way otherwise. THANKS IN ADVANCE Regards, Navin
Re: Queue hogging by a single consumer.
Thanks James. Thanks for the response I will try out your suggestions and get back to you soon. Hi James, Thanks for your response. Are you trying to implement request-response with A, B, C making requests on Z and getting the response? Or can A, B, C process any message from Z? Exactly the first case. A, B, C making requests on Z and getting the response from Z I'm not sure if your issue is that say A doesn't see the responses for its request (if thats the case use either 3 queues, use temporary queues for the responses or use a selector and a correlationID on the request response) - or is it that you have a small number of responses from Z and they are being hogged by one consumer - in which case setting a small prefetch and a round robin dispatch policy will fix this. Its that, A doesn't see the responses for its requests made. I would really appreciate if I can get some help stuff on - 1) Creating, destroying and maintaining data in temporary queues. 2) Setting selector and correlationID in messages. Details here http://incubator.apache.org/activemq/how-should-i-implement-request-response-with-jms.html for 1) just call session.createTemporaryQueue() and set that queue on the Message.setJMSReplyTo() property so that services can reply to your temporary queue. They are deleted when A terminates so there's no issue with maintaining data. for 2) just add a JMSCorrelationID() to the request messages you send as requests. You can then use a selector such as JMSCorrelationID = 'abc' on the consumer for responses so that responses are filtered to only return A's results etc The contract of Z whichever option you go with is the to copy the JMSCorrelationID property from the request to the response message and send the response message to the request.getJMSReployTo() destination Regards, Navin
Queue hogging by a single consumer.
Hi all :) I am working with the binary version of ActiveMQ 4.0 broker and trying out the openwire cpp apis for asynchronous messaging. [https://svn.apache.org/repos/asf/incubator/activemq/tags/activemq-4.0/openw ire-cpp] I wonder if I m resurrecting the mummies of issues already burnt. I am trying out having 3 consumers A, B and C listening on the same queue. What I am trying to do is - A, B, C sending on Q1, and consuming Z's response on Q2 Consumer Z listening on Q1, responding back on Q2. like this - A/B/CQ1ZQ2A/B/C Listening/responding to a single consumer is working well at present. BUT broker is spoofing up the responses from Z to the simultaneous consumers (either 2 or all three). Response for one consumer (A) is going to any of the other consumer (B/C). Same is happening for other consumers. Being prefetch size preset to 1000, the consumer that first manages session with the broker on a queue is getting all the messages (and if it gets terminated, the following one hogs the all and so on.) . As I m at presently testing, setting prefetch size to less (say 1), even dont solves the purpose as not giving it frequest quick requests (man Vs machine). Moreover as the hogging consumer is reading and acknowledging all the responses, the prefetch size of even 1 is not surpassed. I tried out with no success the way of grid processing of messages (using MessageGroups) as suggested in http://activemq.org/site/how-do-i-preserve-order-of-messages.html Code relevant of this is as follows - [A/B/C producer = session-createProducer(Q1) ; producer-setPersistent(true) ; message = session-createBytesMessage() ; message-setJMSXGroupID(cheese) ; message-writeString(Hello World) ; producer-send(message); .] [ .Z ' s OnMessage(message)... pstring NGid; NGid = message-getJMSXGroupID(); producer = session-createProducer(Q2) ; producer-setPersistent(true) ; reqMessage = session-createBytesMessage() ; reqMessage-setJMSXGroupID(NGid-c_str() ); reqMessage-writeString(R E C E I V E D) ; //response string producer-send(reqMessage); .] Is there anymore needed in the code that I m loosing? I come to know that there are certain issues yet not resolved pertaining to the prefetch buffer initial size. Correct me please. Will manipulation of prefetch buffer size help my cause? Please suggest a way otherwise. HELP ME.. THANKS IN ADVANCE Regards, Navin
Openwire C++ APIs minus JMSXUserID
Hi James, I regret this delayed feedback. On 8/1/06, Naveen Rawat [EMAIL PROTECTED] wrote: Hi all. I am using the binary version of ActiveMQ 4.0 broker and openwire cpp APIs to interface my cpp server with the broker. [ Openwire APIs being taken from - svn co https://svn.apache.org/repos/asf/incubator/activemq/tags/activemq-4.0/openwire-cpp] Please help in solving my queries :- 1. Does the broker itself has the mechanism to support multiple senders to a receiver listening on the same queue? Yes 2. Does openwire cpp APIs provides for maintaining Broker's Authentication Policy? If not what could be the alternative. You can send the userName and passsword to the broker when making a connection. The security is then performed by the broker. 3. How can a sender be authenticated among a senders? The broker can authorize individual consumers or sends to determine if a user has the right to use a specific destination... http://incubator.apache.org/activemq/security.html My sender maintains a username and password for connecting to the broker and I have set the populateJMSXUserID option to true in activemq.xml. The broker tag reads like - broker useJmx=true populateJMSXUserID=true My sender connection creating code is as - connection = factory-createConnection(naveen, rawat) ; Am I missing anything here? No - you should receive the JMSXUserID header on messages received. Does this UserID fetched from the received message's header has to be set to the reply message header - so as to make reply in synch with the particular sender client? Also, I am not getting any function as such in my set of OpenWire APIs to retreive the JMSXUserID from the message header. There are functions for manipulating other header options but not for JMSXUserID. My openwire APIs are from above mentioned svn location. Am I missing on it or it is actually not there? Any other way please suggest. 4. For the above created sender is it required for the consumer to authenticate sender or is it solely the ActiveMQ job? The broker does the authentication and authorization. The JMSXUserID is purely so a consumer can see the userName of the sender (and since the broker specifies this it can't be spoofed). -- James Thanks and Regards, Naveen Rawat
AMQ production status
Hi James We have our servers in C/C++. We are trying out available open source MQ services for maintaining persistent communication with our servers through our C++ and web clients. We tried the tests available for both Stomp and Openwire and got very little success with Stomp C++ (caught up with the persistency issue) and considerable with openwire C++ (I have an issue regarding this mailed to the mailing list on 06-July-2006). 1) Are both these C++ APIs (Stomp and Openwire) worth implementation and usage right now, or they are being made more ROBUST? 2) When can we see a PRODUCTION-able AMQ along with its full throttled APIs? Hearty Regards Naveen Rawat
RE: AMQ production status
Hi Nate Thanks for the information. Just out of curiosity, which Stomp C++ client did you try? The reason I ask is that we just submitted a replacement for the CMS client in activemq-cpp. This API does appear to have support for persistence, although I'm not sure that we have a unit test that verifies it yet. We are using the main.cpp file that comes in /test along with the Stomp C++ APIs from svn : https://svn.apache.org/repos/asf/incubator/activemq/trunk/cms. We have segregated the main.cpp into a sender and a receiver. 1) From where can I get the fresh CMS replacement as told by you. Can you provide the specific location? I would try activemq-cpp, if you haven't already - it's leaps and bounds above the old CMS code! 2) I am using ActiveMQ 4.0.x java version. Is activemq-cpp a C++ MQ server? If, then what's its capacity against Java, .Net clients. Hearty Regards Naveen Rawat
[no subject]
Hi there..!! I was trying out CMS OPENWIRE C++ APIs on SUSE Linux 10.0(Kernel release 2.6.13-15.8-default) Whenever I try to execute TestMain.cpp it gives the following and goes into sleep mode. Connecting to ActiveMQ broker... Opening socket to: 127.0.0.1 on port 61666 Sending command: cmd.id = 1, corr.id = -1, type = CONNECTION_INFO Received command: cmd.id = 0, corr.id = -1, type = WIRE_FORMAT_INFO Received command: cmd.id = 1, corr.id = -1, type = BROKER_INFO My AMQ Server is running as : ACTIVEMQ_HOME: /home/nrawat/incubator-activemq-4.0 Loading message broker from: xbean:activemq.xml Created MBeanServer with ID: da6bf4:10c2b32b38c:-8000:kuwix:1 INFO BrokerService - ActiveMQ 4.0 JMS Message Broker (localhost) is starting INFO BrokerService - For help or more information please see: http://incubator.apache.org/activemq/ RMIConnectorServer started at: service:jmx:rmi://kuwix/jndi/rmi://localhost:1099/jmxrmi INFO ManagementContext - JMX consoles can connect to service:jmx:rmi://kuwix/jndi/rmi://localhost:1099/jmxrmi INFO JDBCPersistenceAdapter - Database driver recognized: [apache_derby_embedded_jdbc_driver] INFO JournalPersistenceAdapter - Journal Recovery Started from: Active Journal: using 5 x 20.0 Megs at: /home/nrawat/incubator-activemq-4.0/activemq-data/journal INFO JournalPersistenceAdapter - Journal Recovered: 0 message(s) in transactions recovered. INFO TransportServerThreadSupport - Listening for connections at: tcp://kuwix:61666 WARN MulticastDiscoveryAgent- brokerName not set INFO TransportConnector - Connector default Started INFO TransportServerThreadSupport - Listening for connections at: tcp://kuwix:61633?wireFormat=stomp INFO TransportConnector - Connector stomp Started INFO NetworkConnector - Network Connector default Started INFO BrokerService - ActiveMQ JMS Message Broker (localhost, ID:kuwix-2163-1151775977128-1:0) started Hearty Regards, Naveen Rawat