Skip to content

Conversation

garyrussell
Copy link
Contributor

Resolves #45

Avoid propagation of received headers when sending o.s.messaging.Messages.

Also add Message<?> methods to the template.

Resolves spring-projects#45

Avoid propagation of received headers when sending `o.s.messaging.Message`s.

Also add `Message<?>` methods to the template.
Object key = headers.get(KafkaHeaders.MESSAGE_KEY);
Object payload = message.getPayload();
Assert.isTrue(topic == null || topic instanceof String, "topic header must be a String");
Assert.isTrue(partition == null || partition instanceof Integer, "partition header must be an Integer");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use an overloaded version of MessageHeaders.get() with the Class to cast instead?

@artembilan
Copy link
Member

Here is a polishing how I assume them: artembilan@213cfcc

@garyrussell
Copy link
Contributor Author

Doh; thanks; pushed - also fixed those send methods.

@artembilan
Copy link
Member

Merged as 753d9bd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants