Java Code Examples for org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory#setBlockOnAcknowledge()

The following examples show how to use org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory#setBlockOnAcknowledge() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JMSUtil.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public static Connection createConnection(final String connectorFactory) throws JMSException {
   ActiveMQJMSConnectionFactory cf = (ActiveMQJMSConnectionFactory) ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(connectorFactory));

   cf.setBlockOnNonDurableSend(true);
   cf.setBlockOnDurableSend(true);
   cf.setBlockOnAcknowledge(true);

   return cf.createConnection();
}
 
Example 2
Source File: JMSUtil.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public static ConnectionFactory createFactory(final String connectorFactory,
                                              final long connectionTTL,
                                              final long clientFailureCheckPeriod) throws JMSException {
   ActiveMQJMSConnectionFactory cf = (ActiveMQJMSConnectionFactory) ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(connectorFactory));

   cf.setBlockOnNonDurableSend(true);
   cf.setBlockOnDurableSend(true);
   cf.setBlockOnAcknowledge(true);
   cf.setConnectionTTL(connectionTTL);
   cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);

   return cf;
}