Hi Matthias,
Thanks for the details. Yes, it should work with one phase commit
too. I was just trying to reason out the one phase commit (the picture
you had attached).
Might depend on what the RM in Sonic is doing when the one phase commit
is happening. Would be good to get the details of whats going on in the
transaction. Could you turn on jts and jts logging to FINEST in
Glassfish and see if it prints the transactions. We could check if there
is a rollback happening when stopping GlassFish or if the message is being
Does undeploying the MDB also cause the message to be put back in the
Queue ? or does this happen only when stopping the server.
Could you please attach logs with generic jms ra log level FINEST
Thanks
-Ramesh
matthias.fraass_at_tricoder.net wrote:
> Ah, anonymizing FAIL ;)
>
> OurConnectionFactory_int = NoaConnectionFactory_int
> aQueue = aHolger
>
> -Matthias
>
> 2010/1/6 matthias.fraass_at_tricoder.net <matthias.fraass_at_gmail.com>:
>
>> Hi Ramesh,
>>
>> ATM there is only one resource in the transaction. So maybe 2pc is not
>> needed - I'm not sure about this.
>> But it should work anyway, shouldn't it?
>>
>> Scenario:
>> - Putting a TextMessage into a Sonic Queue via Glassfish -> genericra -> Sonic
>> - Receiving this Message via Sonic -> genericra -> Glassfish-MDB
>>
>> What happens is:
>> - we're seeing the Queue contains one Message on the Sonic
>> - the onMessage() of the MDB is called and executed successfully
>> - we're seeing the Queue is empty again on the Sonic, so it seems like
>> the messages got delivered successfully
>> - we are stopping Glassfish
>> -> the Queue is full again on the Sonic! After Starting Glassfish
>> again, the message that was already delivered before is delivered
>> again, which is OK. But it shouldn't be there anymore.
>>
>> We're sending the TextMessage via RESTful WebService:
>>
>> @Stateless
>> @Path("/jms")
>> public class JMSRestfulWebService {
>> @Resource(mappedName = "OurConnectionFactory_int")
>> private ConnectionFactory sonicConnectionFactory;
>> @Resource(mappedName = "aQueue")
>> private Queue sonicQueue;
>>
>> @Path("sonic")
>> @GET
>> @TransactionAttribute(TransactionAttributeType.REQUIRED)
>> public String putMessageSonic() throws NamingException, JMSException,
>> NotSupportedException, SystemException, SecurityException,
>> IllegalStateException, RollbackException, HeuristicMixedException,
>> HeuristicRollbackException
>> {
>> System.out.println("called putMessageAdapter->Sonic");
>> javax.jms.Connection connection = null;
>> javax.jms.Session session = null;
>> MessageProducer messageProducer = null;
>>
>> try
>> {
>> connection = sonicConnectionFactory.createConnection();
>> session = connection.createSession(true,0);
>> messageProducer = session.createProducer(sonicQueue);
>> TextMessage message = session.createTextMessage();
>> message.setText("Hello, sonic JMS! #");
>> messageProducer.send(message);
>>
>> return "JMS remotely produced 1 message for sonic #;
>> }
>> finally
>> {
>> if (messageProducer != null) try { messageProducer.close(); }
>> catch (Exception ignore) { }
>> if (session != null) try { session.close(); } catch (Exception ignore) { }
>> if (connection != null) try { connection.close(); } catch
>> (Exception ignore) { }
>> }
>> }
>> }
>>
>> And this is our configuration, Glassfish-side
>>
>> asadmin deploy \temp\genericra\genericra.rar
>>
>> asadmin create-resource-adapter-config --property
>> UseFirstXAForRedelivery=true:SupportsXA=true:ProviderIntegrationMode=jndi:UserName=user:Password=secret:JndiProperties=java.naming.factory.initial\=com.sonicsw.jndi.mfcontext.MFContextFactory,java.naming.provider.url\=tcp\://localhost\:13508,com.sonicsw.jndi.mfcontext.domain\=dmOttoDev,java.naming.security.principal\=user,java.naming.security.credentials\=secret:LogLevel=FINEST
>> genericra
>>
>> asadmin create-connector-connection-pool --raname genericra
>> --connectiondefinition javax.jms.XAQueueConnectionFactory
>> --transactionsupport XATransaction --property
>> ConnectionFactoryJndiName=NoaConnectionFactory_int
>> NoaConnectionFactory_intCP
>> asadmin create-connector-resource --poolname
>> NoaConnectionFactory_intCP NoaConnectionFactory_int
>> asadmin create-admin-object --raname genericra --restype
>> javax.jms.Queue --property DestinationJndiName=aHolger aHolger
>>
>>
>>> Could you please find out the status of the transactions (COMPLETED / PENDING/STARTED ) from Sonic MQ before stopping GlassFish.
>>>
>> I don't know how to do this :(.
>>
>> -Matthias
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_genericjmsra.dev.java.net
> For additional commands, e-mail: users-help_at_genericjmsra.dev.java.net
>
>