Before this change CompositeMessageConverter had a ContentTypeResolver
field that was in turn set on all contained converters.
After this change that field is removed and effectively
CompositeMessageConverter is a simple container of other converters.
Each converter in turn must have been configured with a
ContentTypeResolver.
Doing so means it is less likely to have unexpected consequences when
configuring converters, the ContentTypeResolver set in the composite
converter overriding the one configured in a contained converter.
Also commit 676ce6 added default ContentTypeResolver initialization
to AbstractMessageConverter, which ensures that converters are still
straight forward to configure.
Issue: SPR-11462
Previously AbstractMessageConverter did not have a ContentTypeResolver
configured by default. However the Java config and XML namespace in
spring-messaging and spring-websocket always configured one.
This change ensures every AbstractMessageConverter is configured with an
instance of DefaultContentTypeResolver by default. This makes sense since
all the resolver does is make an attempt to find a content type to use
for matching. If it can't it returns null and it's up to the converter
to decide whether it can convert or not.
Issue: SPR-11462
AbstractMessageConverter now supports a strictContentTypeMatching mode
in which the content type of a message must be resolved to a (non-null)
value that matches one of the configured supported MIME types in order
for the converter to be used.
Issue: SPR-11463
Before this change tests on the CI server showed the following message:
Store limit is 102400 mb, whilst the data directory:
/opt/.../KahaDB only has 74810 mb of usable space
This change turns off store persistence and also explicitly sets the
limit on memory usage.
Prior to this commit, one couldn't set the virtualHost property on
StompBrokerRelayMessageHandler via JavaConfig, since
StompBrokerRelayRegistration's API didn't offer that possibility.
This commit adds a new method in StompBrokerRelayRegistration's fluent
API to set the virtualHost used by StompBrokerRelayMessageHandler.
Note: this property is already configurable via xml config.
Issue: SPR-11433
Before this change, when a client subscribed to a "user" destination
(e.g. /user/foo), actual messages received in response to that
subscription contained the server-translated, unique user destination
(e.g. /foo-user123).
This is not an issue for clients such as stomp.js since the
subscription is unique and sufficient to match subscription responses.
However, other STOMP clients do additional checks on the destination
of the subscription and the response.
This change ensures that messages sent to clients on user destionations
always contain a destination that matches the one on the original
subscription.
Issue: SPR-11423
Before this change, issues surrounding the use of @Controller's in
combination with AOP proxying, resulted in an IllegalArgumentException
when trying to invoke the controller method.
This change detects such cases proactively and reports them with a
clear recommendation to use class-based proxying when it comes to
@Controller's. This is the most optimcal approach for controllers
in many respects, also allows @MVC annotations to remain on the
class.
The documentation has also been updated to have a specific section
on @Controller's and AOP proxying providing the same advice.
Issue:SPR-11281
Headers provided to the SimpMessagingTemplate's convertAndSend methods
are now automatically moved into the "nativeHeaders" sub-map. This
ensures the headers will go out with the STOMP message and be received
by subscribers.
Issue: SPR-11387
Assertions made in callbacks invoked on separate thread were not
reaching the test framework. This fix ensures failures are detected
and cause tests to fail.
Prior to this commit, all MethodMessageHandlers tests were
implemented in a single class. Since SimpAnnotationMsgHandler
has been refactored with an abstract class, tests also
needed such a refactoring.
This commit creates test fixtures for AbstractMethodMessageHandler.
Issue: SPR-11191
Prior to this commit, several spring-messaging exceptions
had defined serialVersionUIDs. Those exception aren't
supposed to leave the system via Java serialization; also,
their deserialization is supported only against the same
version of Spring.
Issue: SPR-11339
The interface is to be implemented in addition to
java.security.Principal when Principal.getName() is not globally unique
enough for use in user destinations.
Issue: SPR-11327
The @Header annotation in spring-messaging now resolves values from the
nested "nativeHeaders" map as well as top-level header map values.
In case of ambiguity (a value that exists in both), the top-level map
value is used and a warning message is printed. This is unlikly in most
cases but can be resolved by prefixing the header value with
"nativeHeadres.myHeader".
Issue: SPR-11326
DefaultUserDestinationResolver now uses the session id of
SUBSCRIBE/UNSUBSCRIBE messages rather than looking up all session id's
associated with a user.
Issue: SPR-11325
Before this change DefaultUserDestinationResolver provided a separate
destination prefix property for identifying "user" destinations in
subscription requests as opposed to in sent messages. Such a separate
property should not be needed.
Issue: SPR-11263
Configurers and BeanDefinitionParsers should use
OptionalValidatorFactoryBean instead of
LocalValidatorFactoryBean.
The Optional implementation catches and logs setup
exceptions, useful when a validation API is present on
the classpath but not the actual implementation.
Issue: SPR-11272
Payload parameters in @MessageMapping annotated
methods can now also be validated when annotated
with a Validation annotation (@Valid, @Validated...).
A default Validator is registered by the MessageBroker
Configurer, but it is possible to provide a list of custom
validators as well.
Issue: SPR-11185
Since the MessageHeaders constructor is makes a copy of the headers and
is protected against a null map, there is no need for the same to be
done in GenericMessage.
Issue: SPR-11268