Re: Strange plug with delivering messages to MDB
Hi, I have faced this problem. The work around was to set both maxMessagesPerSessions and maxSessions to the same value and ensure that it is less than the instanceLimit of the MdbContainer (By default it is 10) but configurable via system properties. I have added a comment to the JIRA explaining the same. Regards Manu On Jan 24, 2008 3:12 AM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Jan 23, 2008 6:19 PM, Kevan Miller [EMAIL PROTECTED] wrote: I probably won't have a chance to look at this until this weekend... Me too and that's why I'm quiet lately. Had to finish some other assignments (cf. openejb). Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: Strange plug with delivering messages to MDB
To explain further maxSessions and maxMessagesPerSessions activation config properties are 10 by default and so is the MdbContainer instanceLimit. maxMessagePerSessions is actually the prefetch size and maxSessions is the no of parallel sessions. In case you want to use maxMessagesPerSessions as 1 i.e fetch only 1 message from queue at a time for a listener then you need to set maxSession also as 1 and it will process all the messages albeit sequentially. I am not sure why maxSessions and maxMessagesPerSessions should always be the same for the Mdbs to work but i guess it is something AMQ related. On Jan 27, 2008 12:32 AM, Manu George [EMAIL PROTECTED] wrote: Hi, I have faced this problem. The work around was to set both maxMessagesPerSessions and maxSessions to the same value and ensure that it is less than the instanceLimit of the MdbContainer (By default it is 10) but configurable via system properties. I have added a comment to the JIRA explaining the same. Regards Manu On Jan 24, 2008 3:12 AM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Jan 23, 2008 6:19 PM, Kevan Miller [EMAIL PROTECTED] wrote: I probably won't have a chance to look at this until this weekend... Me too and that's why I'm quiet lately. Had to finish some other assignments (cf. openejb). Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: Strange plug with delivering messages to MDB
On Jan 26, 2008, at 2:07 PM, Manu George wrote: To explain further maxSessions and maxMessagesPerSessions activation config properties are 10 by default and so is the MdbContainer instanceLimit. maxMessagePerSessions is actually the prefetch size and maxSessions is the no of parallel sessions. In case you want to use maxMessagesPerSessions as 1 i.e fetch only 1 message from queue at a time for a listener then you need to set maxSession also as 1 and it will process all the messages albeit sequentially. I am not sure why maxSessions and maxMessagesPerSessions should always be the same for the Mdbs to work but i guess it is something AMQ related. Hi Manu, Thanks for the info. I think that gives us a fairly good idea of where the problem may lie. However, I'm a bit doubtful that your work-around will actually work. I wouldn't be surprised to see some missing messages... :( I'm not very familiar with the MdbContainer implementation... But will have a look. --kevan
Re: Strange plug with delivering messages to MDB
Has anybody had a chance to look at Beniamin's problem? I think it would be a good idea to understand this issue, before cutting 2.1 If I recall correctly, Beniamin didn't have a test program he could share with us. We may need to rig one up. I don't see an MDB test in testsuite. Probably something good to add. I probably won't have a chance to look at this until this weekend... --kevan On Jan 17, 2008, at 11:32 AM, Tomasz Mazan wrote: I got MDB that listens to queue for messages. This MDB uses ConnectionFactory to get connection to send answer to received message. Destination is gotten from replyTo message's field. There's quote from my resource adapter's deployment plan: resourceadapter resourceadapter-instance resourceadapter-nameDriversJms/resourceadapter-name nam:workmanager xmlns:nam=http://geronimo.apache.org/xml/ns/naming-1.2; nam:gbean-linkDefaultWorkManager/nam:gbean-link /nam:workmanager /resourceadapter-instance outbound-resourceadapter connection-definition connectionfactory-interfacejavax.jms.ConnectionFactory/ connectionfactory-interface connectiondefinition-instance nameDriversJmsXAConnectionFactory/name connectionmanager xa-transaction transaction-caching / /xa-transaction single-pool max-size10/max-size blocking-timeout-milliseconds5000/blocking-timeout- milliseconds select-one-assume-match/ /single-pool /connectionmanager /connectiondefinition-instance /connection-definition /outbound-resourceadapter /resourceadapter My driver (MDB) uses activation config from openejb-jar.xml: message-driven ejb-nameDas220JmsDriver/ejb-name nam:resource-adapter nam:resource-linkDriversJms/nam:resource-link /nam:resource-adapter activation-config activation-config-property activation-config-property-namedestination/activation-config- property-name activation-config-property-valueJmsDispatcherDAS220Request/ activation-config-property-value /activation-config-property activation-config-property activation-config-property-namedestinationType/activation-config- property-name activation-config-property-valuejavax.jms.Queue/activation-config- property-value /activation-config-property activation-config-property activation-config-property-nameacknowledgeMode/activation-config- property-name activation-config-property-valueAuto-acknowledge/activation- config-property-value /activation-config-property activation-config-property activation-config-property-nameInitialRedeliveryDelay/activation- config-property-name activation-config-property-value3/activation-config-property- value /activation-config-property activation-config-property activation-config-property-nameMaximumRedeliveries/activation- config-property-name activation-config-property-value/activation-config-property- value /activation-config-property activation-config-property activation-config-property-namemaxMessagesPerSessions/activation- config-property-name activation-config-property-value1/activation-config-property- value /activation-config-property /activation-config /message-driven I set maxMessagesPerSessions because sometimes MDB has to consume more messages (it depends on currently processed message - it's kind of cleaning queue from messages with lower priority). Now I've disabled this functionality, but in future it should work, so I don't want to set greater valie for maxMessahesPerSessions. Where's the problem ? MDB processes let's say 7-13 messages and don't execute onMessage
Re: Strange plug with delivering messages to MDB
On Jan 23, 2008 6:19 PM, Kevan Miller [EMAIL PROTECTED] wrote: I probably won't have a chance to look at this until this weekend... Me too and that's why I'm quiet lately. Had to finish some other assignments (cf. openejb). Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: Strange plug with delivering messages to MDB
Tomasz Mazan wrote: djencks wrote: On Jan 18, 2008, at 12:05 AM, Tomasz Mazan wrote: djencks wrote: Do you have a second resource adapter configured for the inbound messages to the mdb? I seem to recall someone reporting a similar problem if they sent the same message they received. If they copied the message into a new message and sent that everything worked as expected. Are you sending the same message or copying it? I don't know which behavior is expected by the jms spec. thanks david jencks David, 1) I use the same resource adapter for the inbound/outbound messages. 2) I create new Message to send as reply Following your advice I had tried to drop received messages and I remarked that problem is in creating new connection. There's no problem with delivering messages since I've commented that part of my code, but obviously... that doesn't solve my problem. I've tried something else which looks as good solution - change connectionmanager transaction's setting from xa-transaction to local-transaction. I don't see any reason to use XA for my MDB which only receives message - process it using webservice client - and return response to another jms queue. If using local-transaction in your connector configuration fixes the problem then there is a bug in activemq xa handling or possibly our transaction manager. I wonder if activemq 5 would work better, but it seems to be non-trivial to integrate it. thanks david jencks Beniamin -- View this message in context: http://www.nabble.com/Strange-plug- with-delivering-messages-to-MDB-tp14923100s134p14947998.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com. David Using local-transaction causes strange effect: - MDB says that response has been sent - logs shows transaction COMMIT but no message is not delivered to destination Only using independent RA for inbound and outbound messages solving my problem. Beniamin Another case which I noticed after sending over 2000 messages to MDB (this MDB only receive message, and doesn't create any new Connection). After delivering a bit over 1000 messages MDB stopped receiving any new. Beniamin -- View this message in context: http://www.nabble.com/Strange-plug-with-delivering-messages-to-MDB-tp14923100s134p15016851.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Strange plug with delivering messages to MDB
djencks wrote: On Jan 18, 2008, at 12:05 AM, Tomasz Mazan wrote: djencks wrote: Do you have a second resource adapter configured for the inbound messages to the mdb? I seem to recall someone reporting a similar problem if they sent the same message they received. If they copied the message into a new message and sent that everything worked as expected. Are you sending the same message or copying it? I don't know which behavior is expected by the jms spec. thanks david jencks David, 1) I use the same resource adapter for the inbound/outbound messages. 2) I create new Message to send as reply Following your advice I had tried to drop received messages and I remarked that problem is in creating new connection. There's no problem with delivering messages since I've commented that part of my code, but obviously... that doesn't solve my problem. I've tried something else which looks as good solution - change connectionmanager transaction's setting from xa-transaction to local-transaction. I don't see any reason to use XA for my MDB which only receives message - process it using webservice client - and return response to another jms queue. If using local-transaction in your connector configuration fixes the problem then there is a bug in activemq xa handling or possibly our transaction manager. I wonder if activemq 5 would work better, but it seems to be non-trivial to integrate it. thanks david jencks Beniamin -- View this message in context: http://www.nabble.com/Strange-plug- with-delivering-messages-to-MDB-tp14923100s134p14947998.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com. David Using local-transaction causes strange effect: - MDB says that response has been sent - logs shows transaction COMMIT but no message is not delivered to destination Only using independent RA for inbound and outbound messages solving my problem. Beniamin -- View this message in context: http://www.nabble.com/Strange-plug-with-delivering-messages-to-MDB-tp14923100s134p14998766.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Strange plug with delivering messages to MDB
On Jan 18, 2008, at 12:05 AM, Tomasz Mazan wrote: djencks wrote: Do you have a second resource adapter configured for the inbound messages to the mdb? I seem to recall someone reporting a similar problem if they sent the same message they received. If they copied the message into a new message and sent that everything worked as expected. Are you sending the same message or copying it? I don't know which behavior is expected by the jms spec. thanks david jencks David, 1) I use the same resource adapter for the inbound/outbound messages. 2) I create new Message to send as reply Following your advice I had tried to drop received messages and I remarked that problem is in creating new connection. There's no problem with delivering messages since I've commented that part of my code, but obviously... that doesn't solve my problem. I've tried something else which looks as good solution - change connectionmanager transaction's setting from xa-transaction to local-transaction. I don't see any reason to use XA for my MDB which only receives message - process it using webservice client - and return response to another jms queue. If using local-transaction in your connector configuration fixes the problem then there is a bug in activemq xa handling or possibly our transaction manager. I wonder if activemq 5 would work better, but it seems to be non-trivial to integrate it. thanks david jencks Beniamin -- View this message in context: http://www.nabble.com/Strange-plug- with-delivering-messages-to-MDB-tp14923100s134p14947998.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.