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

Ack MqttMessage in Sink Flow #1747

Merged
merged 29 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e529c83
add ack after publish
nsandroni Jun 6, 2019
a0a2efe
rollback mqttflowstage and refactor with ack
nsandroni Jun 10, 2019
8de1b99
test added
nsandroni Jun 11, 2019
e1ebeec
format code
nsandroni Jun 11, 2019
c7cc03f
await for result
nsandroni Jun 11, 2019
06392df
unig testsink & testsource
nsandroni Jun 12, 2019
28ec954
closing run-flow for paradox
nsandroni Jun 12, 2019
18f286f
Try for prevent failure on await
nsandroni Jun 12, 2019
1de184d
rebuild
nsandroni Jun 12, 2019
5573dcd
rebuild
nsandroni Jun 12, 2019
917f77a
rebuild
nsandroni Jun 12, 2019
b4fc990
using inheritance from MqttFlowStage
nsandroni Jun 12, 2019
1bd54ae
add mima filters
nsandroni Jun 13, 2019
469f8ed
moving mima in the right folder
nsandroni Jun 13, 2019
a322fb5
mima filter, using abstract flowstage
nsandroni Jun 14, 2019
5dfb9f0
using same config for access to mqtt
nsandroni Jun 14, 2019
dfab610
remove useless method from MqttSource, removing marker from test, add…
nsandroni Jun 14, 2019
38e68af
format and remove tag
nsandroni Jun 14, 2019
6f3bea2
random topic and sleep for ack
nsandroni Jun 17, 2019
0e518f8
scala documentation for MqttFlow.atLeastOnceWithAck
nsandroni Jun 17, 2019
fa4350d
abstract class MqttMessageWithAckImpl for javadsl, add documentation …
nsandroni Jun 18, 2019
fa1eeb0
add eventually on test scala
nsandroni Jun 18, 2019
97387ad
indent
nsandroni Jun 18, 2019
018cc27
add java test
nsandroni Jun 18, 2019
d8f0644
import snipplet on docs, test are now with fixed topic ( from acl fil…
nsandroni Jun 19, 2019
bdb7978
Update docs/src/main/paradox/mqtt.md
nsandroni Jun 20, 2019
9f88618
Update docs/src/main/paradox/mqtt.md
nsandroni Jun 20, 2019
3e1e95a
Update docs/src/main/paradox/mqtt.md
nsandroni Jun 20, 2019
780cf73
Update docs/src/main/paradox/mqtt.md
nsandroni Jun 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/src/main/paradox/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,29 @@ Java
: @@snip [snip](/mqtt/src/test/java/docs/javadsl/MqttFlowTest.java) { #run-flow }


## Using flow with Acknowledge on message sent

It is possible to create a flow that receives `MqttMessageWithAck` instead of `MqttMessage`.
In this case, when the message is successfully sent to the broker, an ack is sent.
This flow can be used when the source must be acknowledged **only** when the message is successfully sent to the destination topic. This provides *at-least-once* semantics.

The flow emits `MqttMessageWithAck`s with the message swapped with the new content and keeps the ack function from the original source.

Scala
: @@snip [snip](/mqtt/src/test/scala/docs/scaladsl/MqttFlowSpec.scala) { #create-flow-ack }

Java
: @@snip [snip](/mqtt/src/test/java/docs/javadsl/MqttFlowTest.java) { #create-flow-ack }

Run the flow by connecting a source of messages to be published and a sink for received messages.
When the message are sent, an ack is called.

Scala
: @@snip [snip](/mqtt/src/test/scala/docs/scaladsl/MqttFlowSpec.scala) { #run-flow-ack }

Java
: @@snip [snip](/mqtt/src/test/java/docs/javadsl/MqttFlowTest.java) { #run-flow-ack }

## Capturing MQTT client logging

The Paho library uses its own logging adapter and contains a default implementation to use `java.util.logging`. See [Paho/Log and Debug](https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client).
Expand Down
2 changes: 2 additions & 0 deletions mqtt/src/main/mima-filters/1.0.x.backwards.excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Allow changes to impl
ennru marked this conversation as resolved.
Show resolved Hide resolved
ProblemFilters.exclude[Problem]("akka.stream.alpakka.mqtt.impl.*")
Loading