org.springframework.integration.handler.GenericHandler Java Examples

The following examples show how to use org.springframework.integration.handler.GenericHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CallCenterAppApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(String.class, new GenericHandler<String>() {
                @Override
                public Object handle(String payload, Map<String, Object> headers) {
                    log.info("Message retrieved:");
                    log.info(payload);
                    // TODO:
                    // Use the client id to find the transaction and determine if
                    // we have to offer investment opportunities to the client
                    return null;
                }
            }).get();
}
 
Example #2
Source File: NotificationsApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(String.class, new GenericHandler<String>() {
                @Override
                public Object handle(String payload, Map<String, Object> headers) {
                    log.info("Message retrieved:");
                    log.info(payload);
                    // TODO:
                    // Use the client id to find the transaction and determine the
                    // preferred notification channels
                    return null;
                }
            }).get();
}
 
Example #3
Source File: ExternalBanksApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(String.class, new GenericHandler<String>() {
                @Override
                public Object handle(String payload, Map<String, Object> headers) {
                    log.info("Message retrieved:");
                    log.info(payload);
                    // TODO:
                    // Use the client id to find the transaction and determine if a notification
                    // should be sent to external banks
                    return null;
                }
            }).get();
}
 
Example #4
Source File: CallCenterAppApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(TransferMoneyDetails.class, new GenericHandler<TransferMoneyDetails>() {
                @Override
                public Object handle(TransferMoneyDetails payload, Map<String, Object> map) {
                    log.info("Verifying if we have to offer investment opportunities to customer with id: " + payload.getCustomerId());
                    log.info("Transaction details: " + payload);
                    return null;
                }
            }).get();
}
 
Example #5
Source File: NotificationsApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(TransferMoneyDetails.class, new GenericHandler<TransferMoneyDetails>() {
                @Override
                public Object handle(TransferMoneyDetails payload, Map<String, Object> map) {
                    log.info("Notifying by preferred channels to customer with id: " + payload.getCustomerId());
                    log.info("Transaction details: " + payload);
                    return null;
                }
            }).get();
}
 
Example #6
Source File: ExternalBanksApplication.java    From Software-Architecture-with-Spring-5.0 with MIT License 5 votes vote down vote up
@Bean
IntegrationFlow integrationFlow(EventNotificationChannel eventNotificationChannel) {
    return IntegrationFlows.from(eventNotificationChannel.subscriptionOnMoneyTransferredChannel()).
            handle(TransferMoneyDetails.class, new GenericHandler<TransferMoneyDetails>() {
                @Override
                public Object handle(TransferMoneyDetails payload, Map<String, Object> map) {
                    log.info("Should we notify to external banks: " + payload.isExternalBank());
                    if (payload.isExternalBank()) {
                        log.info("Notifying to external bank about transaction: " + payload);
                    }
                    return null;
                }
            }).get();
}
 
Example #7
Source File: Application.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
IntegrationFlow inboundProcess(FlowableInboundGateway inboundGateway) {
    return IntegrationFlows
            .from(inboundGateway)
            .handle(new GenericHandler<DelegateExecution>() {
                @Override
                public Object handle(DelegateExecution execution, MessageHeaders headers) {
                    return MessageBuilder.withPayload(execution)
                            .setHeader("projectId", "2143243")
                            .setHeader("orderId", "246")
                            .copyHeaders(headers).build();
                }
            })
            .get();
}