Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Add conversion functions to get JmsMessages from jms.Messages #1787

Merged
merged 4 commits into from
Jul 2, 2019
Merged

WIP Add conversion functions to get JmsMessages from jms.Messages #1787

merged 4 commits into from
Jul 2, 2019

Conversation

codingismy11to7
Copy link

@codingismy11to7 codingismy11to7 commented Jun 27, 2019

This makes it easy to get the Alpakka JmsMessages with the body, all headers, and all JMS properties intact.

This is a first pass, I only have so much time to work on this so wanted to get some discussion before going any further with anything else that will be required.

Purpose

JmsProducer requires Alpakka JmsMessage model objects to produce messages in a flow (or plain body objects with no headers in a sink). While implementing a standard request/reply model, I found there was no automatic way to convert a jms.Message to a JmsMessage while keeping headers & properties intact (need fields such as correlationId and replyTo from the original message).

I added the missing standard JMS headers in JmsHeader, and added conversions from jms.[Map|Text|Bytes|Object]Message to their corresponding JmsMessage instances.

References

https://discuss.lightbend.com/t/alpakka-activemq-request-response-with-pooled-temporary-queues/4012/9

Changes

Background Context

@ennru
Copy link
Member

ennru commented Jun 28, 2019

This looks very good. At first glance, I didn't see anything to object on.

You might want to add something to the docs which initiated this PR as I wrote down in #1782 to show this PR in context.

This makes it easy to get the Alpakka JmsMessages with the body, all headers, and all JMS properties intact.
@codingismy11to7
Copy link
Author

Removed the @author comment IDEA added and added documentation

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

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

LGTM.

jms/src/test/java/docs/javadsl/JmsConnectorsTest.java Outdated Show resolved Hide resolved
@ennru
Copy link
Member

ennru commented Jul 1, 2019

Looks good, but has compilation errors on both Scala 2.11 and 2.13:

https://travis-ci.com/akka/alpakka/jobs/211931446#L977

https://travis-ci.com/akka/alpakka/jobs/211931447#L2127

@ennru
Copy link
Member

ennru commented Jul 2, 2019

I pushed fixes for the Scala versions compatibility and added a Java API to make the use from Java nicer.

@ennru ennru merged commit 3b7eefd into akka:master Jul 2, 2019
@ennru ennru added this to the 1.1.0 milestone Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants