Skip to content

Instantly share code, notes, and snippets.

View MovileGente's full-sized avatar

Movile MovileGente

View GitHub Profile
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head> <!--[if gte mso 15]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml><![endif]--> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="https://bam.nr-data.net/1/98debe0088?a=22367170&amp;v=1071.385e752&amp;to=dF9ZQ0oJWlhRR00AD1ZZW2heCllDG0UQABReVUAYSw5ZQw%3D%3D&amp;rst=29&amp;ref=https://app.rdstation.com.br/email/1833956/novo/conteudo&amp;ap=191&amp;be=7&amp;fe=24&amp;dc=11&amp;af=err,xhr,stn,ins&amp;perf=%7B%22timing%22:%7B%22of%22:1528236491562,%22n%22:0,%22rpe%22:0,%22dl%22:0,%22di%22:1,%22ds%22:1,%22de%22:1,%22dc%22:1,%22l%22:1,%22le%22:1%7D,%22navigation%22:%7B%7D%7D&amp;jsonp=NREUM.setToke
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head> <!--[if gte mso 15]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml><![endif]--> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml><![endif]--> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="https://bam.nr-data.net/1/98debe0088?a=22367170&amp;v=1071.385e752&amp;to=dF9ZQ0oJWlhRR00AD1ZZW2heCllDG0UQABReVUAYSw5ZQw%3D%3D&amp;rst=109&amp;ref=https://app.rdstation.com.br/email/1833947/novo/conteudo&amp;ap=111&amp;be=15&amp;fe=58&amp;dc=24&amp;af=err,xhr,stn,ins&amp;perf=%7B%22timing%22:%7B%22of%22:1528236646534,%22n%22:0,%22rpe%22:1,%22dl%22:1,%22di%22:2,%22ds%22:2,%22de%22:2,%22dc%22:2,%22l%22:3,%22le%22:3%7D,%22navigation%22:%7B%7D%7D&amp;jsonp=NREUM.setTo
public interface Processor extends Source, Sink {
}
public interface Sink {
String INPUT = "input";
@Input(Sink.INPUT)
SubscribableChannel input();
}
public interface MySink {
String INPUT1 = "input1";
String INPUT2 = "input2";
@Input(Sink.INPUT1)
SubscribableChannel input1();
@Input(Sink.INPUT2)
SubscribableChannel input2();
}
cloud.stream:
bindings.input:
destination: payment-approval-topic
group: payment-service-consumer
bindings.output:
destination: payment-notification-topic
contentType: application/json
@EnableBinding({Source.class})
public class SubscriptionRequestsProducer {
private final Source source;
public SubscriptionRequestsProducer(Source source) {
this.source = source;
}
public void requestApproval(Map<String, Object> subscriptionRequest) {
source.output().send(MessageBuilder.withPayload(subscriptionRequest).build());
@EnableBinding({Processor.class})
public class PaymentProcessor {
private final Logger LOGGER = LoggerFactory.getLogger(PaymentProcessor.class);
@SendTo(Processor.OUTPUT)
@StreamListener(target = Processor.INPUT)
public Message<Map<String, Object>> processPayment(Message<Map<String, Object>> paymentApprovalRequest) {
Map<String, Object> request = paymentApprovalRequest.getPayload();
………..
@EnableBinding({Sink.class})
public class EmailSink {
private static final Logger LOGGER = LoggerFactory.getLogger(EmailSink.class);
@StreamListener(target = Sink.INPUT, condition = "headers['notificationPriority']=='normal'")
public void sentEmail(Message<Map<String, Object>> paymentNotification) {
String status = String.valueOf(paymentNotification.getPayload().getOrDefault("status", "pending"));
LOGGER.info("Normal Payment =" + status);
}
cloud.stream:
bindings.input:
destination: payment-notification-topic
group: email-service-consumer