Last active
December 8, 2019 22:27
-
-
Save mmornati/3b133fa3ebac67548e58df98cefc246e to your computer and use it in GitHub Desktop.
Consume Operation Message
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
@Component | |
@RequiredArgsConstructor | |
public class OperationMessageConsumer { | |
private static final LoggerService LOGGER = LoggerServiceFactory.getLoggerService(OperationMessageConsumer.class); | |
private final MyExternalService service; | |
private static final ObjectMapper MAPPER = new ObjectMapper(); | |
@RabbitListener(id = LISTENER_ID, queues = Queues.OPERATIONS, containerFactory = "rabbitListener") | |
public void handlePspCallMessage(Message message) throws IOException { | |
OperationMessage operationMessage = MAPPER.readerFor(OperationMessage.class).read(message.getBody()); | |
service.doWhatYouNeed(operationMessage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment