Java Code Examples for org.apache.activemq.ActiveMQConnectionFactory#setConnectionIDPrefix()

The following examples show how to use org.apache.activemq.ActiveMQConnectionFactory#setConnectionIDPrefix() . 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: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ActiveMQConnectionFactory clientJmsConnectionFactory() {
  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(properties.getJms().getUrl());
  factory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());
  factory.setTrustAllPackages(true);
  
  ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
  prefetchPolicy.setAll(100);
  factory.setPrefetchPolicy(prefetchPolicy);
  
  return factory;
}
 
Example 2
Source File: AdminJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ActiveMQConnectionFactory adminActiveMQConnectionFactory() {
  String url = properties.getJms().getUrl();

  ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
  connectionFactory.setClientIDPrefix("C2MON-SERVER-CLIENT");
  connectionFactory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());

  ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
  prefetchPolicy.setQueuePrefetch(0);
  connectionFactory.setPrefetchPolicy(prefetchPolicy);
  return connectionFactory;
}
 
Example 3
Source File: ClientJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ActiveMQConnectionFactory clientActiveMQConnectionFactory() {
  String url = properties.getJms().getUrl();
  ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
  connectionFactory.setClientIDPrefix("C2MON-SERVER-CLIENT");
  connectionFactory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());
  connectionFactory.setTrustAllPackages(true);
  return connectionFactory;
}
 
Example 4
Source File: HeartbeatJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ActiveMQConnectionFactory heartbeatConnectionFactory() {
  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(properties.getJms().getUrl());
  factory.setClientIDPrefix("C2MON-SERVER-HEARTBEAT");
  factory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());
  return factory;
}
 
Example 5
Source File: RequestReplyNoAdvisoryNetworkTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private ActiveMQConnectionFactory createConnectionFactory(BrokerService brokerService) throws Exception {
   String target = brokerService.getTransportConnectors().get(0).getPublishableConnectString();
   ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(target);
   factory.setWatchTopicAdvisories(false);
   factory.setConnectionIDPrefix(connectionIdMarker + brokerService.getBrokerName());
   return factory;
}
 
Example 6
Source File: DaqJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
private ActiveMQConnectionFactory createNewConnectionFactory(String brokerUrl) {
  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUrl);
  factory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());
  return factory;
}
 
Example 7
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
private ActiveMQConnectionFactory createNewConnectionFactory(String brokerUrl) {
  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUrl);
  factory.setConnectionIDPrefix(properties.getJms().getConnectionIDPrefix() + properties.getJms().getClientIdPrefix());
  return factory;
}