I have:
- A hornetq-2.2.14-final standalone server
- A client application C1 that send messages to queue A
- A client application C2 that consume messages from a queue A
C1 use jmstemplate for sending messages in CLIENT_ACKNOWLEDGE mode:
<bean name="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="sessionAcknowledgeModeName" value="CLIENT_ACKNOWLEDGE" />
<property name="sessionTransacted" value="true" />
</bean>
so C2 should acknowledge messages manually:
@Override
@Transactional
public void onMessage(Message message)
{
try
{
messageHandlerService.handleReceivedMessage(message);
message.acknowledge();
}
catch (DeserializeXmlException e)
{
// TODO log
e.printStackTrace();
}
catch (InvalidMessageException e)
{
//TODO log
e.printStackTrace();
}
catch (JMSException e)
{
//TODO log
e.printStackTrace();
}
}
My questions:
- What will happen to a message, when Client C2 received that message, but crashes before acknowledge it?
- Is there any timeout mechanism? if yes,What is default timeout for acknowledgment? how can i modify it?