Skip to content

Commit

Permalink
Fix bug of converting system properties from EventData to Spring mess…
Browse files Browse the repository at this point in the history
…age in Eventhub binder (#22683)

* fix bug of converting system properties

* add changelog
  • Loading branch information
yiliuTo authored Jul 6, 2021
1 parent c8119b7 commit 026370a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-cloud-autoconfigure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 2.7.0-beta.1 (Unreleased)
### Key Bug Fixes
- Fixed `EventHubMessageConverter` to load all system properties of `EventData` and put in the header of org.springframework.messaging.Message.([#22683](https://github.com/Azure/azure-sdk-for-java/pull/22683/))


## 2.6.0 (2021-06-23)
Expand Down
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-cloud-starter-eventhubs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 2.7.0-beta.1 (Unreleased)
### Key Bug Fixes
- Fixed `EventHubMessageConverter` to load all system properties of `EventData` and put in the header of org.springframework.messaging.Message.([#22683](https://github.com/Azure/azure-sdk-for-java/pull/22683/))


## 2.6.0 (2021-06-23)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 2.7.0-beta.1 (Unreleased)
### Key Bug Fixes
- Fixed `EventHubMessageConverter` to load all system properties of `EventData` and put in the header of org.springframework.messaging.Message.([#22683](https://github.com/Azure/azure-sdk-for-java/pull/22683/))


## 2.6.0 (2021-06-23)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Supplier<Flux<Message<String>>> supply(Sinks.Many<Message<String>> many)
public Consumer<Message<String>> consume() {
return message -> {
LOGGER.info("EventHubBinderRecordModeIT: New message received: '{}'", message.getPayload());
if (message.getPayload().equals(EventHubBinderSyncModeIT.message)) {
if (message.getPayload().equals(EventHubBinderSyncModeIT.message) && message.getHeaders().containsKey("x-opt-enqueued-time")) {
latch.countDown();
}
};
Expand Down
3 changes: 2 additions & 1 deletion sdk/spring/azure-spring-integration-eventhubs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 2.7.0-beta.1 (Unreleased)

### Key Bug Fixes
- Fixed `EventHubMessageConverter` to load all system properties of `EventData` and put in the header of org.springframework.messaging.Message.([#22683](https://github.com/Azure/azure-sdk-for-java/pull/22683/))

## 2.6.0 (2021-06-23)
### New Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ protected Map<String, Object> buildCustomHeaders(EventData azureMessage) {

private Map<String, Object> getSystemProperties(EventData azureMessage) {
Map<String, Object> result = new HashMap<>();
result.putAll(azureMessage.getSystemProperties());
result.put(EventHubHeaders.ENQUEUED_TIME, azureMessage.getEnqueuedTime());
result.put(EventHubHeaders.OFFSET, azureMessage.getOffset());
result.put(EventHubHeaders.SEQUENCE_NUMBER, azureMessage.getSequenceNumber());
Expand Down

0 comments on commit 026370a

Please sign in to comment.