SHARE
TWEET

Untitled

a guest Apr 20th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top