Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5077b6cc
Commit
5077b6cc
authored
Apr 01, 2014
by
Jean Detoeuf
Committed by
Dave Syer
Apr 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ActiveMqCredentials (optional)
Fixes gh-618
parent
d119336f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
ActiveMQProperties.java
...gframework/boot/autoconfigure/jms/ActiveMQProperties.java
+20
-0
JmsTemplateAutoConfiguration.java
.../boot/autoconfigure/jms/JmsTemplateAutoConfiguration.java
+15
-4
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/ActiveMQProperties.java
View file @
5077b6cc
...
...
@@ -32,6 +32,10 @@ public class ActiveMQProperties {
private
boolean
pooled
=
false
;
private
String
user
;
private
String
password
;
// Will override brokerURL if inMemory is set to true
public
String
getBrokerUrl
()
{
if
(
this
.
inMemory
)
{
...
...
@@ -60,4 +64,20 @@ public class ActiveMQProperties {
this
.
pooled
=
pooled
;
}
public
String
getUser
()
{
return
this
.
user
;
}
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
public
String
getPassword
()
{
return
this
.
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateAutoConfiguration.java
View file @
5077b6cc
...
...
@@ -64,15 +64,26 @@ public class JmsTemplateAutoConfiguration {
@Bean
public
ConnectionFactory
jmsConnectionFactory
()
{
ConnectionFactory
connectionFactory
;
if
(
this
.
config
.
getUser
()
!=
null
&&
!
""
.
equals
(
this
.
config
.
getUser
())
&&
this
.
config
.
getPassword
()
!=
null
&&
!
""
.
equals
(
this
.
config
.
getPassword
()))
{
connectionFactory
=
new
ActiveMQConnectionFactory
(
this
.
config
.
getUser
(),
this
.
config
.
getPassword
(),
this
.
config
.
getBrokerUrl
());
}
else
{
connectionFactory
=
new
ActiveMQConnectionFactory
(
this
.
config
.
getBrokerUrl
());
}
if
(
this
.
config
.
isPooled
())
{
PooledConnectionFactory
pool
=
new
PooledConnectionFactory
();
pool
.
setConnectionFactory
(
new
ActiveMQConnectionFactory
(
this
.
config
.
getBrokerUrl
()));
pool
.
setConnectionFactory
(
connectionFactory
);
return
pool
;
}
return
new
ActiveMQConnectionFactory
(
this
.
config
.
getBrokerUrl
());
else
{
return
connectionFactory
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment