org.springframework.jms.connection.SingleConnectionFactory Java Examples
The following examples show how to use
org.springframework.jms.connection.SingleConnectionFactory.
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: ProcessCommunicationManagerImpl.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void stop() { if (running) { running = false; try { LOGGER.debug("Shutting down ProcessCommunicationManager bean and associated JMS connections."); if (processOutConnectionFactory instanceof SingleConnectionFactory) { ((SingleConnectionFactory) processOutConnectionFactory).destroy(); } } catch (Exception e) { LOGGER.error("Exception caught when trying to shutdown the server->DAQ JMS connections:", e); e.printStackTrace(System.err); } } }
Example #2
Source File: BatchedMessageListenerContainer.java From jadira with Apache License 2.0 | 5 votes |
public Connection createConnection() throws JMSException { if (BatchedMessageListenerContainer.this.sharedConnectionEnabled()) { Connection sharedCon = BatchedMessageListenerContainer.this.getSharedConnection(); return new SingleConnectionFactory(sharedCon).createConnection(); } else { return BatchedMessageListenerContainer.this.createConnection(); } }
Example #3
Source File: SimulatorJmsAutoConfiguration.java From citrus-simulator with Apache License 2.0 | 5 votes |
@Bean @ConditionalOnMissingBean public ConnectionFactory connectionFactory() { if (configurer != null) { return configurer.connectionFactory(); } return new SingleConnectionFactory(); }
Example #4
Source File: MQHierachy.java From Thunder with Apache License 2.0 | 5 votes |
private void initializeSingleConnectionFactory() throws Exception { boolean reconnectOnException = mqPropertyEntity.getBoolean(ThunderConstant.MQ_RECONNECT_ON_EXCEPTION_ATTRIBUTE_NAME); SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory(); singleConnectionFactory.setReconnectOnException(reconnectOnException); connectionFactory = singleConnectionFactory; }
Example #5
Source File: AbstractPollingMessageListenerContainer.java From spring-analysis-note with MIT License | 5 votes |
@Override public Connection createConnection() throws JMSException { if (AbstractPollingMessageListenerContainer.this.sharedConnectionEnabled()) { Connection sharedCon = AbstractPollingMessageListenerContainer.this.getSharedConnection(); return new SingleConnectionFactory(sharedCon).createConnection(); } else { return AbstractPollingMessageListenerContainer.this.createConnection(); } }
Example #6
Source File: ClientModuleLifecycle.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
/** * Constructor. * @param clientJmsContainer JMS container used in client module * @param clientExecutor thread pool used by container * @param singleConnectionFactory client request connection factory * */ @Autowired public ClientModuleLifecycle(@Qualifier("clientRequestJmsContainer") final DefaultMessageListenerContainer clientJmsContainer, @Qualifier("clientExecutor") final ThreadPoolExecutor clientExecutor, @Qualifier("clientSingleConnectionFactory") final SingleConnectionFactory singleConnectionFactory, @Qualifier("adminRequestJmsContainer") final DefaultMessageListenerContainer adminJmsContainer, @Qualifier("adminSingleConnectionFactory") final SingleConnectionFactory adminSingleConnectionFactory) { super(); this.clientJmsContainer = clientJmsContainer; this.clientExecutor = clientExecutor; this.singleConnectionFactory = singleConnectionFactory; this.adminConnectionFactory = adminSingleConnectionFactory; this.adminJmsContainer = adminJmsContainer; }
Example #7
Source File: ActiveMqConfig.java From roncoo-pay with Apache License 2.0 | 5 votes |
/** * 队列模板 * * @param singleConnectionFactory 连接工厂 * @return 队列模板 */ @Bean(name = "jmsTemplate") public JmsTemplate jmsTemplate(@Qualifier("connectionFactory") SingleConnectionFactory singleConnectionFactory) { JmsTemplate notifyJmsTemplate = new JmsTemplate(); notifyJmsTemplate.setConnectionFactory(singleConnectionFactory); notifyJmsTemplate.setDefaultDestinationName(orderQueryDestinationName); return notifyJmsTemplate; }
Example #8
Source File: ActiveMqListenerConfig.java From roncoo-pay with Apache License 2.0 | 5 votes |
/** * 消息监听容器 * * @param singleConnectionFactory 连接工厂 * @param orderQueryQueueDestination 消息目的地 * @param pollingMessageListener 监听器实现 * @return 消息监听容器 */ @Bean(name = "orderQueryQueueMessageListenerContainer") public DefaultMessageListenerContainer orderQueryQueueMessageListenerContainer(@Qualifier("connectionFactory") SingleConnectionFactory singleConnectionFactory, @Qualifier("orderQueryQueueDestination") ActiveMQQueue orderQueryQueueDestination, @Qualifier("pollingMessageListener") PollingMessageListener pollingMessageListener) { DefaultMessageListenerContainer messageListenerContainer = new DefaultMessageListenerContainer(); messageListenerContainer.setConnectionFactory(singleConnectionFactory); messageListenerContainer.setDestination(orderQueryQueueDestination); messageListenerContainer.setMessageListener(pollingMessageListener); return messageListenerContainer; }
Example #9
Source File: ActiveMqListenerConfig.java From roncoo-pay with Apache License 2.0 | 5 votes |
/** * 消息监听容器 * * @param singleConnectionFactory 连接工厂 * @param tradeQueueDestination 消息目的地 * @param consumerSessionAwareMessageListener 监听器实现 * @return 消息监听容器 */ @Bean(name = "tradeQueueMessageListenerContainer") public DefaultMessageListenerContainer tradeQueueMessageListenerContainer(@Qualifier("connectionFactory") SingleConnectionFactory singleConnectionFactory, @Qualifier("tradeQueueDestination") ActiveMQQueue tradeQueueDestination, @Qualifier("consumerSessionAwareMessageListener") ConsumerSessionAwareMessageListener consumerSessionAwareMessageListener) { DefaultMessageListenerContainer messageListenerContainer = new DefaultMessageListenerContainer(); messageListenerContainer.setConnectionFactory(singleConnectionFactory); messageListenerContainer.setMessageListener(consumerSessionAwareMessageListener); messageListenerContainer.setDestination(tradeQueueDestination); return messageListenerContainer; }
Example #10
Source File: AbstractPollingMessageListenerContainer.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Override public Connection createConnection() throws JMSException { if (AbstractPollingMessageListenerContainer.this.sharedConnectionEnabled()) { Connection sharedCon = AbstractPollingMessageListenerContainer.this.getSharedConnection(); return new SingleConnectionFactory(sharedCon).createConnection(); } else { return AbstractPollingMessageListenerContainer.this.createConnection(); } }
Example #11
Source File: AbstractPollingMessageListenerContainer.java From java-technology-stack with MIT License | 5 votes |
@Override public Connection createConnection() throws JMSException { if (AbstractPollingMessageListenerContainer.this.sharedConnectionEnabled()) { Connection sharedCon = AbstractPollingMessageListenerContainer.this.getSharedConnection(); return new SingleConnectionFactory(sharedCon).createConnection(); } else { return AbstractPollingMessageListenerContainer.this.createConnection(); } }
Example #12
Source File: AdminJmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory adminSingleConnectionFactory() { return new SingleConnectionFactory(adminActiveMQConnectionFactory()); }
Example #13
Source File: ClientJmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory clientSingleConnectionFactory() { return new SingleConnectionFactory(clientActiveMQConnectionFactory()); }
Example #14
Source File: HeartbeatJmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory heartbeatSingleConnectionFactory() { return new SingleConnectionFactory(heartbeatConnectionFactory()); }
Example #15
Source File: DaqJmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory processOutConnectionFactory() { return new SingleConnectionFactory(daqOutActiveMQConnectionFactory()); }
Example #16
Source File: JmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory singleConnectionFactory() { return new SingleConnectionFactory(activeMQConnectionFactory()); }
Example #17
Source File: JmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory filterConnectionFactory() { return new SingleConnectionFactory(filterActiveMQConnectionFactory()); }
Example #18
Source File: JmsConfig.java From c2mon with GNU Lesser General Public License v3.0 | 4 votes |
@Bean public SingleConnectionFactory secondSingleConnectionFactory() { return new SingleConnectionFactory(secondActiveMQConnectionFactory()); }
Example #19
Source File: SimulatorJmsAdapter.java From citrus-simulator with Apache License 2.0 | 4 votes |
@Override public ConnectionFactory connectionFactory() { return new SingleConnectionFactory(); }
Example #20
Source File: ConsumeJMS.java From nifi with Apache License 2.0 | 3 votes |
/** * <p> * Use provided clientId for non shared durable consumers, if not set * always a different value as defined in {@link AbstractJMSProcessor#setClientId(ProcessContext, SingleConnectionFactory)}. * </p> * See {@link Session#createDurableConsumer(javax.jms.Topic, String, String, boolean)}, * in special following part: <i>An unshared durable subscription is * identified by a name specified by the client and by the client identifier, * which must be set. An application which subsequently wishes to create * a consumer on that unshared durable subscription must use the same * client identifier.</i> */ @Override protected void setClientId(ProcessContext context, SingleConnectionFactory cachingFactory) { if (isDurableSubscriber(context) && !isShared(context)) { cachingFactory.setClientId(getClientId(context)); } else { super.setClientId(context, cachingFactory); } }
Example #21
Source File: AbstractJMSProcessor.java From nifi with Apache License 2.0 | 3 votes |
/** * Set clientId for JMS connections when <tt>clientId</tt> is not null. * It is overridden by {@code}ConsumeJMS{@code} when durable subscriptions * is configured on the processor. * @param context context. * @param connectionFactory the connection factory. * @since NIFI-6915 */ protected void setClientId(ProcessContext context, final SingleConnectionFactory connectionFactory) { String clientId = getClientId(context); if (clientId != null) { clientId = clientId + "-" + clientIdCounter.getAndIncrement(); connectionFactory.setClientId(clientId); } }