Advertisement
sleipnir1981

Artemis-ConnectionFactory

Oct 24th, 2019 (edited)
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
  2. import org.slf4j.Logger;
  3. import org.slf4j.LoggerFactory;
  4.  
  5. public class ArtemisFactory {
  6.     private static final Logger log = LoggerFactory.getLogger(ArtemisFactory.class);
  7.  
  8.     public static ActiveMQConnectionFactory connectionFactory(String user, String password, String url, String clientId, int timeout) {
  9.  
  10.         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(url, user, password);
  11.         cf.setClientID(clientId);
  12.         cf.setEnableSharedClientID(true);
  13.         cf.setCacheDestinations(true);
  14.         cf.setEnable1xPrefixes(true);
  15.         return cf;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement