Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix deprecation warning on netty tests and simplify it a bit #401

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.camel.quarkus.component.netty;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;

public class CamelRoute extends RouteBuilder {
Expand All @@ -26,17 +24,14 @@ public class CamelRoute extends RouteBuilder {
public void configure() {

from("netty:tcp://0.0.0.0:8994?textline=true&sync=true")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
if (exchange.getIn().getBody() instanceof Poetry) {
Poetry poetry = (Poetry) exchange.getIn().getBody();
poetry.setPoet("Dr. Sarojini Naidu");
exchange.getOut().setBody(poetry);
return;
}
exchange.getOut()
.setBody("When You Go Home, Tell Them Of Us And Say, For Your Tomorrow, We Gave Our Today.");
.process().message(message -> {
if (message.getBody() instanceof Poetry) {
Poetry poetry = (Poetry) message.getBody();
poetry.setPoet("Dr. Sarojini Naidu");
message.setBody(poetry);
return;
}
message.setBody("When You Go Home, Tell Them Of Us And Say, For Your Tomorrow, We Gave Our Today.");
});

}
Expand Down