Commit Graph

530 Commits

Author SHA1 Message Date
Stéphane Nicoll 1f2d29ee08 Polish 2024-01-08 17:12:33 +01:00
Johnny Lim 0ad561d379 Ensure that Observation is stopped and scope is closed in doReceiveAndExecute()
Closes gh-31798
2024-01-05 14:45:58 +01:00
Stéphane Nicoll adcf236a3d Polish "Use Object.equals() where feasible"
See gh-31916
2023-12-28 13:21:46 +01:00
Yanming Zhou 72a9864788 Use Object.equals() where feasible
See gh-31916
2023-12-28 13:19:03 +01:00
Stéphane Nicoll a6e87b40c7 Polish "Use diamond operator where feasible"
See gh-31916
2023-12-28 13:14:26 +01:00
Yanming Zhou 094479b55f Use diamond operator where feasible
See gh-31916
2023-12-28 13:08:08 +01:00
Stéphane Nicoll 70f31dee45 Polish 2023-12-27 13:04:21 +01:00
Sam Brannen c0683cd30b Update copyright headers 2023-12-12 14:51:03 +01:00
Yanming Zhou afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou 785ad399e9 Replace assertThat(x.iterator().next()) with assertThat(x).element(0)
Search for   : assertThat\((.+).iterator\(\).next\(\)\)
Replace with : assertThat($1).element(0)
2023-12-06 10:52:39 +08:00
Sam Brannen b69e5acfe3 Revert use of yield in switch expressions due to Eclipse compiler error
See gh-31531
2023-12-04 16:47:25 +01:00
Sam Brannen d71853f105 Polish contribution
See gh-31531
2023-12-04 16:47:25 +01:00
Yanming Zhou 490b5c77fc Use switch expression where feasible 2023-12-04 15:42:55 +01:00
Brian Clozel dbb2d4f1d3 Extend JMS observation scope to error handling
Prior to this commit, the JMS listener observations would only cover the
actual listener invocation, but not the error handling phase. This means
that all errors (including the handled ones) are marked as errors in the
observation and that the observation is not current anymore when error
handling happens.

This commit aligns the behavior with the other Spring Framework
instrumentations and ensures that the error handling phase is fully part
of the observation recording.

Closes gh-31559
2023-11-07 11:18:03 +01:00
Juergen Hoeller 8457c768e8 Polishing 2023-10-23 16:56:40 +02:00
Sam Brannen 2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +02:00
Johnny Lim 64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Johnny Lim 919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Brian Clozel 8d6b499cf1 Polish
See gh-31398
2023-10-10 20:42:45 +02:00
Brian Clozel 99c673f3ea Upgrade to Micrometer 1.12.0-RC1
Closes gh-31398
2023-10-10 15:40:32 +02:00
Stéphane Nicoll 95e6902aef Polish "Fix regression in JmsAccessor#setSessionAcknowledgeMode"
See gh-31328
2023-09-29 08:42:56 +02:00
Vedran Pavic 11c2cde62e Fix regression in JmsAccessor#setSessionAcknowledgeMode
This commit partially reverts 3b8dd0a5, which introduced a strict
validation in JmsAccessor#setSessionAcknowledgeMode that prevents use
of vendor-specific acknowledge modes.

See gh-31328
2023-09-29 08:42:38 +02:00
Stéphane Nicoll 0f6b018e97 Merge branch '6.0.x' 2023-09-26 12:30:05 +02:00
Stéphane Nicoll a37abd5e54 Provide best-effort toString for Lazy resolved message
Previously, MessagingMessageListenerAdapter or any adapter relying on
the default MessagingMessageConverter would log an incoming message
with a toString of the Message that does not provide any extra
information. This is due to the default implementation providing a
lazy resolution message that only attempts to extract the payload
when necessary.

This commit implements a toString method that uses the raw JMS message
if the payload is not available. If it is, the payload is used instead.

Closes gh-21265
2023-09-26 12:29:00 +02:00
Sam Brannen 293e6ddf85 Polishing 2023-09-16 15:25:16 +02:00
Juergen Hoeller aa1360b154 Complete set of constructors with consistent javadoc
Closes gh-31234
2023-09-15 17:45:13 +02:00
Marten Deinum e42e89c04f Add constructors to take ObjectMapper
Prior to this commit in the message converters it was possible
to set a pre-configured ObjectMapper. However the constructor
would still create and configure an ObjectMapper.

With the added constructor it is now possible to directly
construct the message converter with the proper ObjectMapper.
This prevents the this additional ObjectMapper to be constructed.
2023-09-15 17:19:51 +02:00
Sam Brannen 0a7166234d Polishing 2023-09-06 11:37:50 +02:00
Johnny Lim 884975e094 Polish JMS observation instrumentation
See gh-30335
Closes gh-31172
2023-09-05 17:18:02 +02:00
Juergen Hoeller 9b50e7ded6 Merge branch '6.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2023-09-03 01:27:18 +02:00
Juergen Hoeller 61f89a1f04 Refine note on listener container setup with CachingConnectionFactory
Closes gh-25503
2023-09-03 01:13:51 +02:00
Sébastien Deleuze 81607238ce Use consistently `@since 6.1` 2023-09-01 12:33:21 +02:00
Sam Brannen 3dcac0cf80 Clean up / Suppress warnings 2023-08-18 12:46:17 +02:00
Sam Brannen 3228502108 Polish MessageListenerContainerObservationTests 2023-08-14 17:08:56 +02:00
Brian Clozel 94fe1f4c63 Guard for Micrometer Core usage in JMS instrumentation
This commit ensures that the Observability instrumentation for
`@JmsListener` does not assume that micrometer-core is on the classpath
and guards against direct usage.

Closes gh-30335
2023-08-14 16:27:45 +02:00
Brian Clozel 2c895974b2 Add observability support for JMS
This commit adds observability support for Jakarta JMS support in
spring-jms support. This feature leverages the `JmsInstrumentation`
infrastructure in `io.micrometer:micrometer-core` library.

This instruments the `JmsTemplate` and the `@JmsListener` support to
record observations:

* "jms.message.publish" when the `JmsTemplate` sends a message
* "jms.message.process" when a message is processed by a `@JmsListener`
  annotated method

The observation `Convention` and `Context` implementations are shipped
with "micrometer-core".

Closes gh-30335
2023-08-13 18:24:51 +02:00
Juergen Hoeller 3253d2de89 Introduce TransactionExecutionListener with begin/commit/rollback notifications
Includes ConfigurableTransactionManager interface for listener registration.
Includes additional introspection methods on TransactionExecution interface.
Includes default method declarations on TransactionStatus/SmartTransactionObject.

Closes gh-27479
2023-08-06 14:03:44 +02:00
Juergen Hoeller d250a5155a Consistent dependency declarations 2023-08-02 00:56:50 +02:00
Juergen Hoeller 3b1af692cc Merge branch '6.0.x'
# Conflicts:
#	spring-beans/spring-beans.gradle
#	spring-context/spring-context.gradle
#	spring-orm/spring-orm.gradle
#	spring-test/spring-test.gradle
#	spring-web/spring-web.gradle
#	spring-webflux/spring-webflux.gradle
2023-08-02 01:04:31 +02:00
Sam Brannen 3b8dd0a5ac Assert JmsAccessor.setSessionAcknowledgeMode() values
See gh-30851
2023-07-31 16:08:47 +03:00
Sam Brannen 9da318af96 Assert JmsActivationSpecConfig.setAcknowledgeMode() values
See gh-30851
2023-07-31 16:08:47 +03:00
Sam Brannen b45bfcafc2 Assert DefaultMessageListenerContainer.setCacheLevel() values
See gh-30851
2023-07-31 16:08:47 +03:00
Sam Brannen 0eda44186a Polish tests for configuration constants
See gh-30851
2023-07-31 16:08:47 +03:00
Juergen Hoeller bbde68c49e Polishing 2023-07-25 19:12:07 +02:00
Juergen Hoeller 5ebbb3ff3e Merge branch '6.0.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java
2023-07-25 19:13:33 +02:00
Sam Brannen b2ca36f098 Stop using Constants utility in JmsAccessor
See gh-30851
2023-07-19 12:16:26 +03:00
Sam Brannen 15253f3448 Polish JmsAccessor[Tests] 2023-07-19 12:16:14 +03:00
Sam Brannen 4e00c988c1 Stop using Constants utility in JmsActivationSpecConfig
See gh-30851
2023-07-19 11:48:28 +03:00
Juergen Hoeller 2ac55659c8 Merge branch '6.0.x' 2023-07-19 01:26:05 +02:00
Juergen Hoeller c64a322e19 Polishing 2023-07-19 01:25:20 +02:00