Class MessagesManager

  • All Implemented Interfaces:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

    @Component
    public class MessagesManager
    extends Object
    implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
    Processor client submits messages to the requests queue and subscribes to the results queue for processed messages.
    • Constructor Detail

      • MessagesManager

        public MessagesManager​(AmqpClient client,
                               org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ server)
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Create a processed messages receiver and subscribe to its messages publisher.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • destroy

        public void destroy()
        Cancel processed messages publisher subscription.
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
      • getProcessedMessages

        public List<String> getProcessedMessages()
        Get messages which were processed up to this moment.
        Returns:
        List of processed messages.
      • processMessage

        public reactor.core.publisher.Mono<Void> processMessage​(String body)
        Submit a message for processing by publishing it to a processing requests queue.
        Parameters:
        body - Message body to be processed.
        Returns:
        Mono which is completed once message is sent.