Interface MatsProfiles
- All Known Implementing Classes:
ScenarioConnectionFactoryProducer
ScenarioConnectionFactoryProducer
and the default configuration of
ConfigurableScenarioDecider
. The latter both checks the Spring Profiles for active profiles with the names
(or, for PROFILE_MATS_TEST
, name prefix) specified here, but also checks the Spring
Environment
for the existence of a property of the same names but with the dash ("-") replaced by dot (".").
The Spring Environment by default consist of System Properties and Environment Variables.
The main documentation for the MatsScenario concept is in the JavaDoc of
ScenarioConnectionFactoryProducer
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
If this Spring Profile ("mats-localhost") is active, the ConnectionFactory specified byScenarioConnectionFactoryProducer.withLocalhostConnectionFactory(ConnectionFactoryProvider)
will be used.static final String
If this Spring Profile ("mats-localvm") is active, the ConnectionFactory specified byScenarioConnectionFactoryProducer.withLocalVmConnectionFactory(ConnectionFactoryProvider)
will be used.static final String
Suggested Profile name ("mats-mocks") (or Profile name prefix if you want to divide the mocks into sets) to use when you mock out project-external collaborator Mats Endpoints for use in the "LocalVM" scenario.static final String
If this Spring Profile ("mats-regular") is active, theConnectionFactory
specified byScenarioConnectionFactoryProducer.withRegularConnectionFactory(ConnectionFactoryProvider)
will be used.static final String
Profile name ("mats-test") that is a synonym toPROFILE_MATS_LOCALVM
wrt.static final String
Common Profile name ("production") that is a synonym toPROFILE_MATS_REGULAR
wrt.static final String
Common Profile name ("staging") that is a synonym toPROFILE_MATS_REGULAR
wrt.
-
Field Details
-
PROFILE_MATS_REGULAR
If this Spring Profile ("mats-regular") is active, theConnectionFactory
specified byScenarioConnectionFactoryProducer.withRegularConnectionFactory(ConnectionFactoryProvider)
will be used. Notice that"production"
and"staging"
for this decision's point of view are pure synonyms to this Profile.Notice: If this Profile (or the synonyms) is active, and any of
"mats-localhost"
,"mats-localvm"
or"mats-mocks"
(or any profile which starts with "mats-mocks") is also active, the setup refuses to start by throwing an Exception - any combination of "regular", "localhost" and "localvm" is meaningless, while the combination "regular" and any resemblance of mocks ("mats-mocks") is probably disastrous.- See Also:
-
PROFILE_PRODUCTION
Common Profile name ("production") that is a synonym toPROFILE_MATS_REGULAR
wrt. deciding to use theConnectionFactory
specified byScenarioConnectionFactoryProducer.withRegularConnectionFactory(ConnectionFactoryProvider)
.- See Also:
-
PROFILE_STAGING
Common Profile name ("staging") that is a synonym toPROFILE_MATS_REGULAR
wrt. deciding to use theConnectionFactory
specified byScenarioConnectionFactoryProducer.withRegularConnectionFactory(ConnectionFactoryProvider)
.- See Also:
-
PROFILE_MATS_LOCALHOST
If this Spring Profile ("mats-localhost") is active, the ConnectionFactory specified byScenarioConnectionFactoryProducer.withLocalhostConnectionFactory(ConnectionFactoryProvider)
will be used.- See Also:
-
PROFILE_MATS_LOCALVM
If this Spring Profile ("mats-localvm") is active, the ConnectionFactory specified byScenarioConnectionFactoryProducer.withLocalVmConnectionFactory(ConnectionFactoryProvider)
will be used.- See Also:
-
PROFILE_MATS_TEST
Profile name ("mats-test") that is a synonym toPROFILE_MATS_LOCALVM
wrt. deciding to use theConnectionFactory
specified byScenarioConnectionFactoryProducer.withLocalVmConnectionFactory(ConnectionFactoryProvider)
.Notice: The
@MatsTestProfile
-annotation is a more succinct way of expressing @ActiveProfiles("mats-test") - it is simply meta-annotated as such.- See Also:
-
PROFILE_MATS_MOCKS
Suggested Profile name ("mats-mocks") (or Profile name prefix if you want to divide the mocks into sets) to use when you mock out project-external collaborator Mats Endpoints for use in the "LocalVM" scenario. Point is that if this e.g. ShoppingCartService needs to talk to the OrderService, you will obviously not have the OrderService Mats Endpoints available when running the ShoppingCartService inside your IDE with an in-vm Local Broker instance. Thus, you mock these out - but annotated with@Profile("mats-mocks")
(or maybe@Profile("mats-mocks-orderservice")
), so that when running with Profile "production", these mocks do not start consuming messages destined for the production OrderService from the production MQ Broker.A benefit of using this Profile name (or a name that starts with this) for the mocks-scenario, is that if by some accident both this profile and Profile
"mats-regular"
or any of its synonyms is enabled at the same time, the service will refuse to start, read javaDoc atPROFILE_MATS_REGULAR
.- See Also:
-