Commit Graph

118 Commits

Author SHA1 Message Date
Juergen Hoeller e58b33a593 Consistent reset of resource holders on doBegin failure
Issue: SPR-12280
2014-10-06 20:31:45 +02:00
Juergen Hoeller 7bc8e5199e Polishing 2014-09-29 23:50:23 +02:00
Juergen Hoeller cfd9fd6863 Polishing 2014-09-29 17:35:23 +02:00
Stephane Nicoll bb45fb4538 Restore sleep interval between recovery attempt
Commit 6a04831 introduced a regression that lead to burst recovery
attempts when the broker is up but the listener is failing for some
reason (the most obvious one being that the destination does not
exist).

Since the sleep period between recovery attempts strategy is more
complex, we can't just sleep for a period of time. But we can create
an execution and apply it once which should work just fine for most
use cases.

Issue: SPR-12183
2014-09-29 15:35:07 +02:00
Sam Brannen 9f6c0cb166 Polish Javadoc for @JmsListener 2014-09-28 15:12:07 +02:00
Juergen Hoeller 58b22ceddc Scheduled/JmsListenerAnnotationBeanPostProcessor avoids needless re-scanning of non-annotated classes
Issue: SPR-12189
2014-09-17 21:55:35 +02:00
Juergen Hoeller 82f8b4330c CachingConnectionFactory proceeds to physicalClose in case of logicalClose exceptions
Issue: SPR-12148
2014-09-04 00:36:17 +02:00
Juergen Hoeller 98eb0f75bc Polishing 2014-09-02 22:15:53 +02:00
Stephane Nicoll da8771d5a9 polishing 2014-09-01 18:31:07 +02:00
Stephane Nicoll 8c4388dd6e Place holder resolution in @JmsListener arguments
This commit allows to use place holder definitions for JmsListener
attributes, effectively allowing to externalize those settings from
the code.

Issue: SPR-12134
2014-09-01 16:27:47 +02:00
Phillip Webb ac8326d2df Polish mockito usage
Consistent use of BDDMockito rather than standard Mockito.
2014-08-11 16:23:11 -07:00
Stephane Nicoll c0ea87010f Improve destination-type documentation
Issue: SPR-12073
2014-08-11 15:43:45 +02:00
Juergen Hoeller c06ac06bdd JmsMessagingTemplate uses local convertJmsException template method instead of generic MessagingExceptionTranslator interface
This commit also turns MessagingException into a NestedRuntimeException subclass which delivers a root message that has the cause message appended to it. That's a common expectation with the use of Spring exceptions since all of our exception hierarchies have historically been designed that way.

Issue: SPR-12064
Issue: SPR-12038
2014-08-09 22:06:50 +02:00
Stephane Nicoll 5b35fc2d77 Add JmsTemplate accessor in JmsMessagingTemplate 2014-08-08 18:09:16 +02:00
Stephane Nicoll c1d149591a Add base header mapper implementation 2014-08-08 16:59:42 +02:00
Stephane Nicoll 4a1a622004 polishing 2014-08-08 09:37:47 +02:00
Stephane Nicoll 3da68cfe21 Remove unused imports 2014-08-04 14:13:40 +02:00
Stephane Nicoll 7d1e33d88d Move JmsHandlerMethodFactory to spring-messaging
This commit moves JmsHandlerMethodFactory and its default
implementation to the messaging abstraction. Working on a similar
support for AMQP revealed that this factory has nothing that is JMS
specific and is exactly identical in the case of AMQP.

Issue: SPR-12053
2014-08-01 16:08:31 +02:00
Stephane Nicoll 515b9649fa Fix javadoc typo 2014-07-30 08:45:26 +02:00
Juergen Hoeller 1fe742addf MessagingExceptionTranslator lives in support subpackage now
Issue: SPR-12038
2014-07-29 16:22:47 +02:00
Stephane Nicoll 89d63eb79b JmsMessagingTemplate exception management
This commit introduces MessagingExceptionTranslator, a messaging
exception translation infrastructure similar to what
PersistenceExceptionTranslator provides.

JmsMessagingTemplate does not throw raw JmsException anymore but
translates those to an instance of Spring's MessagingException
hierarchy.

Issue: SPR-12038
2014-07-29 12:29:43 +02:00
Juergen Hoeller 036896a6b8 Split configuration constants into local XConfigUtils classes instead of piling them up in AnnotationConfigUtils 2014-07-28 21:58:21 +02:00
Juergen Hoeller 92c657e12d JmsListener/ScheduledAnnotationBeanPostProcessor uses SmartInitializingSingleton instead of ContextRefreshedEvent
Also reducing the container dependencies to BeanFactory instead of ApplicationContext, wherever possible.

Issue: SPR-12039
2014-07-28 15:58:13 +02:00
Stephane Nicoll b6389a6c66 Jms request/reply operations
This commit updates JmsMessagingTemplate to support the
MessageRequestReplyOperation interface that provides synchronous
request/reply operations.

As JmsMessagingTemplate delegates everything under the scenes to
JmsTemplate, the latter has been updated as well to offer such lower
level operation.

Issue: SPR-12037
2014-07-28 15:52:50 +02:00
Stephane Nicoll 0a46f38527 polishing 2014-07-24 17:12:31 +02:00
Juergen Hoeller c082220b34 AbstractMessageListenerContainer calls "Session.recover()" in case of rollback attempt on non-transacted Session
Issue: SPR-12015
2014-07-22 16:50:41 +02:00
Juergen Hoeller 3be190df6a Consistent removal of JMS 1.0.2 references 2014-07-18 17:21:31 +02:00
Juergen Hoeller a9100c427c Revision of JMS annotated endpoint support, plus support for JMS 2.0's shared subscriptions
Issue: SPR-9882
Issue: SPR-11969
2014-07-18 17:21:21 +02:00
Stephane Nicoll dd713c70aa Fix typo 2014-07-18 11:50:49 +02:00
Stephane Nicoll 29bdbceaa2 Customize concurrency at listener level
Prior to this commit, customizing the concurrency to use fo a given JMS
listener involved to define it in a specific listener-container. As
this is quite restrictive, users may stop using the XML namespace
support altogether to fallback on regular abstract bean definition for
the container.

This commit adds a concurrency attribute to the jms and jca listener
element as well as on the @JmsListener annotation. If the value is set,
it takes precedence; otherwise the value provided by the factory is
used.

Issue: SPR-11988
2014-07-14 15:49:31 +02:00
Juergen Hoeller 0d4ff1adbf Polishing 2014-07-09 22:25:35 +02:00
Juergen Hoeller fa4f51c5d0 Subpackage rearrangements within 4.1's jms-messaging alignment
Issue: SPR-10873
2014-07-09 22:19:14 +02:00
Juergen Hoeller 1fadd1c954 BackOff abstraction lives in util.backoff subpackage now
Issue: SPR-11746
2014-07-09 21:53:32 +02:00
Juergen Hoeller 55c351523d Polishing 2014-07-07 16:28:48 +02:00
Juergen Hoeller b9a70c6000 Refined CachingConnectionFactory log messages
Issue: SPR-11956
2014-07-05 08:59:11 +02:00
Juergen Hoeller 6fd0fc7005 CachedSessionInvocationHandler includes durable flag in ConsumerCacheKey
Issue: SPR-11956
2014-07-05 08:49:28 +02:00
Juergen Hoeller 7a7641bd23 CachedSessionInvocationHandler properly caches createSharedConsumer results
Issue: SPR-11956
2014-07-04 22:20:19 +02:00
Juergen Hoeller b6a7957dc4 Revised Jms2MessageProducerInvocationHandler implementation with switch statement
Issue: SPR-11950
2014-07-04 16:09:06 +02:00
Stephane Nicoll c2da846732 Add support for extra MessageProducer method
This commit supports two additional methods of the MessageProducer
interface as from JMS 2.0

An integration test infrastructure is necessary to be able to test
those scenario: this is taken care of in a separated initiative.

Issue: SPR-11950
2014-07-04 14:08:56 +02:00
Juergen Hoeller 134e5a2aec Jms2MessageProducerInvocationHandler properly delegates to CachedMessageProducer.this
Issue: SPR-11949
2014-07-04 00:25:43 +02:00
Juergen Hoeller 98d6f7b443 Polishing 2014-06-26 16:01:24 +02:00
Stephane Nicoll 674bad4cfa Clarify the use of sessionTransacted
This commit clarifies the role of the external transactionManager for
a DMLC and the relationship with the sessionTransacted flag

Issue: SPR-9200
2014-06-02 17:52:03 +02:00
Stephane Nicoll 12a9df8a1c Throw a proper exception if no convert is found
Prior to this commit, no exception was raised if a message could not
be converted to the requested payload because no suitable converter
were found.

This commit adds an explicit check if the converted payload is null.

Issue: SPR-11817
2014-05-28 16:48:48 +02:00
Sam Brannen 8dec1db914 Tweak JmsMessagingTemplateTests for Eclipse 4.4
Eclipse 4.4 early release versions have issues with generics.

This commit slightly tweaks the use of generics in
JmsMessagingTemplateTests so that the class compiles in the latest
builds of Eclipse 4.4
2014-05-28 12:45:26 +02:00
Stephane Nicoll 9fabcad3dd Revisit JmsMessagingTemplate
This commit revisits JmsMessagingTemplate and adds support for
receiving operations as well. JmsMessageSendingOperations has been
renamed to JmsMessageOperations.

The messaging abstraction did not split receiving and request-reply
operations. AbstractMessageReceivingTemplate has been created to hold
only the receiving operations.

Issue: SPR-11772
2014-05-26 09:35:03 +02:00
Stephane Nicoll 7469159bf1 Add MessageSendingOperations for JMS
This commit adds a JMS implementation of MessageSendingOperations,
allowing to send JMS messages using Spring's standard Messaging
abstraction.

MessagingMessageConverter is a standard JMS's MessageConverter that
can convert Spring's Message to JMS message and vice versa. Existing
infrastructure has been updated to use this implementation.

Issue: SPR-11772
2014-05-19 10:46:13 +02:00
Juergen Hoeller 5faacd5a3d JmsResourceHolder checks for nested DataSource transactions as well (for Oracle AQ compatibility)
Issue: SPR-11791
2014-05-16 15:08:09 +02:00
Stephane Nicoll 6560aed1c8 Avoid JMSException in listener execution
This commit avoids throwing JMSException from the listener execution
as this is not allowed per spec. Our SessionAwareMessageListener
gives a callback that can throw JMSException and we have "abused" it
so far.

Typical message processing goes in those 3 steps:
* Unmarshall the javax.jms.Message to the requested type
* Invoke the actual user method (including processing of method
  arguments)
* Send a reply message, if any

Those three steps have been harmonized so that they don't throw a
JMSException anymore. For the later case, introduced
ReplyFailureException as a general exception indicating the
reply message could not have been sent.

Issue: SPR-11778
2014-05-15 16:36:08 +02:00
Stephane Nicoll 04e6575db6 polishing
This commit adds an explicit error message when the BackOff instance
has returned BackOffExecution#STOP which basically means that no
further attempts are allowed.

This error message is a convenience way to notify that the container is
about to be shut down.

Issue: SPR-11746
2014-05-13 14:44:14 +02:00
Stephane Nicoll 89fc3c0257 Add BackOffExecution to isolate state
This commit separates the BackOff configuration from an actual
 execution. BackOffExecution now contains all the state of a
 particular execution and BackOff is only meant to start (i.e.
 create) a new execution.

 The method "reset" has been removed as its no longer necessary:
 when an execution does not need to be used for a given operation
 anymore it can be simply discarded.

 Issue: SPR-11746
2014-05-09 16:39:01 +02:00