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

The following examples show how to use org.apache.activemq.ActiveMQConnectionFactory#setTrustAllPackages() . 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: ActiveMqMessagingService.java    From gocd with Apache License 2.0 6 votes vote down vote up
@Autowired
public ActiveMqMessagingService(DaemonThreadStatsCollector daemonThreadStatsCollector, SystemEnvironment systemEnvironment, ServerHealthService serverHealthService) throws Exception {
    this.daemonThreadStatsCollector = daemonThreadStatsCollector;
    this.systemEnvironment = systemEnvironment;
    this.serverHealthService = serverHealthService;

    broker = new BrokerService();
    broker.setBrokerName(BROKER_NAME);
    broker.setPersistent(false);
    broker.setUseJmx(systemEnvironment.getActivemqUseJmx());
    broker.getManagementContext().setConnectorPort(systemEnvironment.getActivemqConnectorPort());
    broker.start();


    factory = new ActiveMQConnectionFactory(BROKER_URL);
    factory.getPrefetchPolicy().setQueuePrefetch(systemEnvironment.getActivemqQueuePrefetch());
    factory.setCopyMessageOnSend(false);
    factory.setTrustAllPackages(true);

    connection = (ActiveMQConnection) factory.createConnection();
    connection.start();

}
 
Example 2
Source File: JmsCommonConfig.java    From Spring with Apache License 2.0 5 votes vote down vote up
@Bean
public ConnectionFactory nativeConnectionFactory(){
    final ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
    cf.setBrokerURL("tcp://localhost:61616");
    cf.setTrustAllPackages(true);
    return cf;
}
 
Example 3
Source File: JobStream.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
public JobStream(Workflow<?> workflow) throws Exception {
	this.workflow = workflow;
	ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(workflow.getBroker());
	connectionFactory.setTrustAllPackages(true);
	connection = connectionFactory.createConnection();
	connection.start();
	session = connection.createSession(false, ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
			
	destination = new HashMap<>();
	pre = new HashMap<>();
	post = new HashMap<>();
}
 
Example 4
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 5
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;
}