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

The following examples show how to use org.apache.activemq.ActiveMQConnectionFactory#setClientIDPrefix() . 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: 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 2
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 3
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 4
Source File: DaqJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ActiveMQConnectionFactory daqInConnectionFactory() {
  String url = properties.getJms().getUrl();
  ActiveMQConnectionFactory connectionFactory = createNewConnectionFactory(url);
  connectionFactory.setClientIDPrefix("C2MON-SERVER-DAQ-IN");
  return connectionFactory;
}
 
Example 5
Source File: DaqJmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public ActiveMQConnectionFactory daqOutActiveMQConnectionFactory() {
  ActiveMQConnectionFactory connectionFactory = createNewConnectionFactory(properties.getJms().getUrl());
  connectionFactory.setClientIDPrefix("C2MON-DAQ-OUT");
  return connectionFactory;
}
 
Example 6
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public ActiveMQConnectionFactory activeMQConnectionFactory() {
  ActiveMQConnectionFactory factory = createNewConnectionFactory(properties.getJms().getUrl());
  factory.setClientIDPrefix("C2MON-DAQ-" + properties.getName());
  return factory;
}
 
Example 7
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public ActiveMQConnectionFactory filterActiveMQConnectionFactory() {
  ActiveMQConnectionFactory factory = createNewConnectionFactory(properties.getFilter().getJms().getUrl());
  factory.setClientIDPrefix("C2MON_DAQ_FILTER");
  return factory;
}
 
Example 8
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public ActiveMQConnectionFactory secondActiveMQConnectionFactory() {
  ActiveMQConnectionFactory factory = createNewConnectionFactory(properties.getJms().getSecondaryUrl());
  factory.setClientIDPrefix("C2MON-DAQ-" + properties.getName());
  return factory;
}