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

Use Map or POJO for MessageHeader #521

Open
j1cs opened this issue Nov 19, 2021 · 0 comments
Open

Use Map or POJO for MessageHeader #521

j1cs opened this issue Nov 19, 2021 · 0 comments
Labels
type: enhancement New feature or request

Comments

@j1cs
Copy link
Contributor

j1cs commented Nov 19, 2021

Feature description

Having the following code;

@PubSubClient(project = "${gcp.project-id}")
public interface ProductPubSubClient {
    @Topic("${pubsub.topic-name}")
    String send(
            DataDto dataDto,
            @MessageHeader(name = "eventId") UUID eventId,
            @MessageHeader(name = "eventType") String eventType,
            @MessageHeader(name = "entityId") String entityId,
            @MessageHeader(name = "entityType") String entityType,
            @MessageHeader(name = "timestamp") long timestamp,
            @MessageHeader(name = "datetime") OffsetDateTime datetime,
            @MessageHeader(name = "version") String version,
            @MessageHeader(name = "country") String country,
            @MessageHeader(name = "commerce") String commerce,
            @MessageHeader(name = "channel") String channel,
            @MessageHeader(name = "capability") String capability,
            @MessageHeader(name = "mimeType") String mimeType
    );
}


String response = this.productPubSubClient.send(
                    productDto.getData(),
                    productDto.getEventId(),
                    productDto.getEventType(),
                    productDto.getEntityId(),
                    productDto.getEntityType(),
                    productDto.getTimestamp(),
                    productDto.getDatetime(),
                    productDto.getVersion(),
                    productDto.getCountry(),
                    productDto.getCommerce(),
                    productDto.getChannel(),
                    productDto.getCapability(),
                    productDto.getMimeType()
            );

it is possible to use a Map of or POJO as Headers?
To avoid write multiples times @MessageHeader

@sdelamo sdelamo added the type: enhancement New feature or request label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants