Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. package com.jvoliveira.producerrest.message;
  2.  
  3. import org.springframework.messaging.Message;
  4. import org.springframework.messaging.support.MessageBuilder;
  5. import org.springframework.stereotype.Component;
  6.  
  7. import com.jvoliveira.producerrest.dto.Product;
  8.  
  9. @Component
  10. public class RestProducer {
  11.  
  12. public boolean sendMessageProduct(Product payload, RestSource restSource){
  13. Message<Product> message = MessageBuilder.withPayload(payload).build();
  14. boolean success = restSource.sendMessage().send(message);
  15. return success;
  16. }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement