This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for producing (#32)
Allows you to send messages to SQS directly, without having to go across an SNS fanout. Closes #31
- Loading branch information
Heiko Rothe
authored
Oct 29, 2021
1 parent
4b5c297
commit 78d2fce
Showing
6 changed files
with
168 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/de/idealo/spring/stream/binder/sqs/SqsHeaders.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package de.idealo.spring.stream.binder.sqs; | ||
|
||
public final class SqsHeaders { | ||
|
||
public static final String PREFIX = "sqs_"; | ||
|
||
public static final String GROUP_ID = PREFIX + "groupId"; | ||
|
||
public static final String DEDUPLICATION_ID = PREFIX + "deduplicationId"; | ||
|
||
private SqsHeaders() {} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/de/idealo/spring/stream/binder/sqs/SqsPayloadConvertingChannelInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.idealo.spring.stream.binder.sqs; | ||
|
||
import org.springframework.messaging.Message; | ||
import org.springframework.messaging.MessageChannel; | ||
import org.springframework.messaging.support.ChannelInterceptor; | ||
import org.springframework.messaging.support.MessageBuilder; | ||
|
||
public class SqsPayloadConvertingChannelInterceptor implements ChannelInterceptor { | ||
|
||
@Override | ||
public Message<?> preSend(Message<?> message, MessageChannel channel) { | ||
return MessageBuilder.createMessage(new String((byte[]) message.getPayload()), message.getHeaders()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters