Last active
May 27, 2017 19:07
-
-
Save mzimecki/66d8bbe905fd2d1ea76f81e9571e8ab8 to your computer and use it in GitHub Desktop.
Spring Application Context configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected AbstractApplicationContext createApplicationContext() { | |
return new AnnotationConfigApplicationContext(ContextConfiguration.class); | |
} | |
@Configuration | |
@EnableAutoConfiguration | |
@ComponentScan(basePackageClasses = {ActivemqConfiguration.class, QueueReaderRoute.class}, | |
useDefaultFilters = false, | |
includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, | |
classes={ActivemqConfiguration.class, QueueReaderRoute.class})) | |
static class ContextConfiguration { | |
} | |
@Configuration | |
static class ActivemqConfiguration { | |
@Bean | |
public ConnectionFactory jmsConnectionFactory() { | |
final PooledConnectionFactory pool = new PooledConnectionFactory(); | |
pool.setConnectionFactory(new ActiveMQConnectionFactory("userName", "password", "tcp://localhost:61616")); | |
return pool; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment