Created
February 9, 2015 23:42
-
-
Save ddossot/af7bfb30341d19b321df to your computer and use it in GitHub Desktop.
RxMule Java 8 Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rxMule | |
.observeEndpointAsync(new URI("http://localhost:8080/publish")) | |
.distinct( | |
muleEvent -> { | |
final String remoteAddressAndPort = | |
muleEvent | |
.getMessage() | |
.getInboundProperty( | |
"MULE_REMOTE_CLIENT_ADDRESS"); | |
return substringBefore(remoteAddressAndPort, ":"); | |
}) | |
.subscribe( | |
asAction((MessageConsumer) | |
muleEvent -> { | |
redisModule.publish( | |
"http-requests", | |
false, | |
muleEvent.getMessageAsString(), | |
muleEvent); | |
LOGGER.info("Published: {}", muleEvent); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment