-
Notifications
You must be signed in to change notification settings - Fork 645
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
SQS: Revise stream element data model #1604
Conversation
Thank you for modernising this with the latest possibilities from the AWS SDK. (run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked closer at your propsal and added the necessary MiMa exclusions, I agree that FifoMessageIdentifiers
should go away.
SqsAckFlow.apply
could be a non-API-breaking.
sqs/src/main/scala/akka/stream/alpakka/sqs/scaladsl/SqsAckFlow.scala
Outdated
Show resolved
Hide resolved
} | ||
.mapAsync(settings.concurrentRequests) { | ||
case (request, response) if !response.failed().isEmpty => | ||
.map { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to remove the unused Future-wrapping.
This PR requires a rebase to incorporate changes from #1606. |
Thanks @ennru. In order to pass all information to downstream, we can encapsulate the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great that you took another look.
I wonder if we wouldn't be able to get rid of the generics altogether if we'd have separate stream element types for the flat and for the grouped flows?
Let's give this the time it needs and release Alpakka 1.0 anyway. I've created #1621 to mark the API as "may change". |
Picking this up again. To reduce the risk for " final class SqsPublishSingleResult @InternalApi private[sqs] (
responseMetadata: SqsResponseMetadata,
metadata: SendMessageResponse,
request: SendMessageRequest
) extends SqsPublishResult[SendMessageResponse](responseMetadata, metadata, request)
final class SqsPublishBatchResult @InternalApi private[sqs] (
responseMetadata: SqsResponseMetadata,
metadata: SendMessageBatchResultEntry,
request: SendMessageRequest
) extends SqsPublishResult[SendMessageBatchResultEntry](responseMetadata, metadata, request) Names can be improved probably, but the API looks simpler with this. WDYT? |
Are we risking a If we do this we should also do the same with |
Yes, you're right. |
Thinking about it again, it's probably better to give a sealed abstract class along with the possible implementations for the SQS model Right now, the output type from the In addition, it would also be nice to provide unapply on the SQS model for the scala users |
Yes, that is what I am looking for. |
I've tried to get rid of the type parameter from the publish and ack results to give a clean API: SqsPublishFlow.apply: Flow[SendMessageRequest, PublishResult, NotUsed]
SqsPublishFlow.grouped: Flow[SendMessageRequest, PublishResultEntry, NotUsed]
SqsAckFlow.apply: Flow[MessageAction, SqsAckResult, NotUsed]
SqsAckFlow.grouped: Flow[MessageAction, SqsAckResultEntry, NotUsed]
In all the There is now no traces of the 'unbounded' The only drawback is on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better, the types are simple and self-explaining.
I'm a bit sceptic to filtering the Ignore
messages, if that's what users need they can use filter
. I foresee we'd like to add some pass-through support going forward and would need a message going through for that.
To leave out the field from equals
makes sense, but you could add a little note on that.
Source<Message, NotUsed> source = Source.fromIterator(messages::iterator); | ||
|
||
CompletionStage<List<SqsAckResult<SqsResponse>>> stage = | ||
CompletionStage<List<SqsAckResult>> stage = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting there...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I might be part of this. I'll squash it locally and merge it.
a36d7c9
to
8c96122
Compare
Thank you for this long-coming improvement! |
Pull Request Checklist
Fixes
Fixes #625
Purpose
Improve SQS batch operations
Background Context
After the AWS SDK update, changes in the AWS models can make the API simpler and cleaner: