Skip to content

Commit a0f364c

Browse files
authored
fix NPE in the Spring Integration *InboundChannelAdapter (Azure#36927)
* fix NPE * add debug logs and update changelog
1 parent 83b5094 commit a0f364c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

sdk/spring/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ This section includes changes in `spring-cloud-azure-autoconfigure` module.
88
#### Bugs Fixed
99
- Fix the issue that prevented the `disableChallengeResourceVerification` property of the AKV `SecretClient` to be configured [#36628](https://github.com/Azure/azure-sdk-for-java/pull/36628).
1010

11+
### Spring Integration Azure Event Hubs
12+
This section includes changes in the `spring-integration-azure-eventhubs` module.
13+
14+
#### Bugs Fixed
15+
- Fix NPE in the error handler of `EventHubsInboundChannelAdapter` when `instrumentationManager` or `instrumentationId` is null [#36927](https://github.com/Azure/azure-sdk-for-java/pull/36927).
16+
17+
### Spring Integration Azure Service Bus
18+
This section includes changes in the `spring-integration-azure-servicebus` module.
19+
20+
#### Bugs Fixed
21+
- Fix NPE in the error handler of `ServiceBusInboundChannelAdapter` when `instrumentationManager` or `instrumentationId` is null [#36927](https://github.com/Azure/azure-sdk-for-java/pull/36927).
22+
1123
## 5.5.0 (2023-08-28)
1224
- This release is compatible with Spring Boot 3.0.0-3.1.2. (Note: 3.1.x (x>2) should be supported, but they aren't tested with this release.)
1325
- This release is compatible with Spring Cloud 2022.0.0-2022.0.4. (Note: 2022.0.x (x>4) should be supported, but they aren't tested with this release.)

sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundChannelAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ public void accept(ErrorContext errorContext) {
209209
}
210210

211211
private void updateInstrumentation(ErrorContext errorContext) {
212-
if (instrumentationManager == null) {
212+
if (instrumentationManager == null || instrumentationId == null) {
213+
LOGGER.debug("InstrumentationManager or instrumentationId is null, skip updateInstrumentation.");
213214
return;
214215
}
215216

sdk/spring/spring-integration-azure-servicebus/src/main/java/com/azure/spring/integration/servicebus/inbound/ServiceBusInboundChannelAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ public void accept(ServiceBusErrorContext errorContext) {
168168
}
169169

170170
private void updateInstrumentation(ServiceBusErrorContext errorContext) {
171-
if (instrumentationManager == null) {
171+
if (instrumentationManager == null || instrumentationId == null) {
172+
LOGGER.debug("InstrumentationManager or instrumentationId is null, skip updateInstrumentation.");
172173
return;
173174
}
174175

0 commit comments

Comments
 (0)