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
41dc7014
Commit
41dc7014
authored
Apr 05, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Prevent warnings when running embedded Artemis"
Closes gh-12680
parent
19818b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
27 deletions
+24
-27
ArtemisEmbeddedConfigurationFactory.java
...gure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java
+13
-20
ArtemisEmbeddedConfigurationFactoryTests.java
...jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java
+11
-7
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java
View file @
41dc7014
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -70,29 +70,22 @@ class ArtemisEmbeddedConfigurationFactory {
...
@@ -70,29 +70,22 @@ class ArtemisEmbeddedConfigurationFactory {
+
this
.
properties
.
getClusterPassword
());
+
this
.
properties
.
getClusterPassword
());
}
}
configuration
.
setClusterPassword
(
this
.
properties
.
getClusterPassword
());
configuration
.
setClusterPassword
(
this
.
properties
.
getClusterPassword
());
configuration
.
addAddressConfiguration
(
createAddressConfiguration
(
"DLQ"
));
configuration
.
addAddressConfiguration
(
createAddressConfiguration
(
"ExpiryQueue"
));
configuration
.
addAddressesSetting
(
"#"
,
configuration
.
addAddressesSetting
(
"#"
,
new
AddressSettings
()
new
AddressSettings
()
.
setDeadLetterAddress
(
SimpleString
.
toSimpleString
(
"DLQ"
))
.
setDeadLetterAddress
(
SimpleString
.
toSimpleString
(
"DLQ"
))
.
setExpiryAddress
(
SimpleString
.
toSimpleString
(
"ExpiryQueue"
)));
.
setExpiryAddress
(
SimpleString
.
toSimpleString
(
"ExpiryQueue"
)));
configuration
.
addAddressConfiguration
(
new
CoreAddressConfiguration
()
.
setName
(
"DLQ"
)
.
addRoutingType
(
RoutingType
.
ANYCAST
)
.
addQueueConfiguration
(
new
CoreQueueConfiguration
()
.
setName
(
"DLQ"
)
.
setRoutingType
(
RoutingType
.
ANYCAST
)));
configuration
.
addAddressConfiguration
(
new
CoreAddressConfiguration
()
.
setName
(
"ExpiryQueue"
)
.
addRoutingType
(
RoutingType
.
ANYCAST
)
.
addQueueConfiguration
(
new
CoreQueueConfiguration
()
.
setName
(
"ExpiryQueue"
)
.
setRoutingType
(
RoutingType
.
ANYCAST
)));
return
configuration
;
return
configuration
;
}
}
private
CoreAddressConfiguration
createAddressConfiguration
(
String
name
)
{
return
new
CoreAddressConfiguration
().
setName
(
name
)
.
addRoutingType
(
RoutingType
.
ANYCAST
)
.
addQueueConfiguration
(
new
CoreQueueConfiguration
().
setName
(
name
)
.
setRoutingType
(
RoutingType
.
ANYCAST
));
}
private
String
getDataDir
()
{
private
String
getDataDir
()
{
if
(
this
.
properties
.
getDataDirectory
()
!=
null
)
{
if
(
this
.
properties
.
getDataDirectory
()
!=
null
)
{
return
this
.
properties
.
getDataDirectory
();
return
this
.
properties
.
getDataDirectory
();
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java
View file @
41dc7014
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -78,18 +78,22 @@ public class ArtemisEmbeddedConfigurationFactoryTests {
...
@@ -78,18 +78,22 @@ public class ArtemisEmbeddedConfigurationFactoryTests {
public
void
hasDlqExpiryQueueAddressSettingsConfigured
()
{
public
void
hasDlqExpiryQueueAddressSettingsConfigured
()
{
ArtemisProperties
properties
=
new
ArtemisProperties
();
ArtemisProperties
properties
=
new
ArtemisProperties
();
Configuration
configuration
=
new
ArtemisEmbeddedConfigurationFactory
(
properties
)
Configuration
configuration
=
new
ArtemisEmbeddedConfigurationFactory
(
properties
)
.
createConfiguration
();
.
createConfiguration
();
Map
<
String
,
AddressSettings
>
addressesSettings
=
configuration
.
getAddressesSettings
();
Map
<
String
,
AddressSettings
>
addressesSettings
=
configuration
assertThat
((
CharSequence
)
addressesSettings
.
get
(
"#"
).
getDeadLetterAddress
()).
isEqualTo
(
SimpleString
.
toSimpleString
(
"DLQ"
));
.
getAddressesSettings
();
assertThat
((
CharSequence
)
addressesSettings
.
get
(
"#"
).
getExpiryAddress
()).
isEqualTo
(
SimpleString
.
toSimpleString
(
"ExpiryQueue"
));
assertThat
((
Object
)
addressesSettings
.
get
(
"#"
).
getDeadLetterAddress
())
.
isEqualTo
(
SimpleString
.
toSimpleString
(
"DLQ"
));
assertThat
((
Object
)
addressesSettings
.
get
(
"#"
).
getExpiryAddress
())
.
isEqualTo
(
SimpleString
.
toSimpleString
(
"ExpiryQueue"
));
}
}
@Test
@Test
public
void
hasDlqExpiryQueueConfigured
()
{
public
void
hasDlqExpiryQueueConfigured
()
{
ArtemisProperties
properties
=
new
ArtemisProperties
();
ArtemisProperties
properties
=
new
ArtemisProperties
();
Configuration
configuration
=
new
ArtemisEmbeddedConfigurationFactory
(
properties
)
Configuration
configuration
=
new
ArtemisEmbeddedConfigurationFactory
(
properties
)
.
createConfiguration
();
.
createConfiguration
();
List
<
CoreAddressConfiguration
>
addressConfigurations
=
configuration
.
getAddressConfigurations
();
List
<
CoreAddressConfiguration
>
addressConfigurations
=
configuration
.
getAddressConfigurations
();
assertThat
(
addressConfigurations
).
hasSize
(
2
);
assertThat
(
addressConfigurations
).
hasSize
(
2
);
}
}
}
}
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