| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:util="http://www.springframework.org/schema/util" |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
| http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd |
| http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> |
| |
| <!-- START SNIPPET: routes --> |
| <camelContext id="multiple-netty-codecs-context" xmlns="http://camel.apache.org/schema/spring"> |
| <route> |
| <from uri="direct:multiple-codec"/> |
| <to uri="netty:tcp://localhost:5150?encoders=#encoders&sync=false"/> |
| </route> |
| <route> |
| <from uri="netty:tcp://localhost:5150?decoders=#length-decoder,#string-decoder&sync=false"/> |
| <to uri="mock:multiple-codec"/> |
| </route> |
| </camelContext> |
| <!-- END SNIPPET: routes --> |
| |
| <!-- START SNIPPET: registry-beans --> |
| <util:list id="decoders" list-class="java.util.LinkedList"> |
| <bean class="org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder"> |
| <constructor-arg value="1048576"/> |
| <constructor-arg value="0"/> |
| <constructor-arg value="4"/> |
| <constructor-arg value="0"/> |
| <constructor-arg value="4"/> |
| </bean> |
| <bean class="org.jboss.netty.handler.codec.string.StringDecoder"/> |
| </util:list> |
| |
| <util:list id="encoders" list-class="java.util.LinkedList"> |
| <bean class="org.jboss.netty.handler.codec.frame.LengthFieldPrepender"> |
| <constructor-arg value="4"/> |
| </bean> |
| <bean class="org.jboss.netty.handler.codec.string.StringEncoder"/> |
| </util:list> |
| |
| <bean id="length-encoder" class="org.jboss.netty.handler.codec.frame.LengthFieldPrepender"> |
| <constructor-arg value="4"/> |
| </bean> |
| <bean id="string-encoder" class="org.jboss.netty.handler.codec.string.StringEncoder"/> |
| |
| <bean id="length-decoder" class="org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder"> |
| <constructor-arg value="1048576"/> |
| <constructor-arg value="0"/> |
| <constructor-arg value="4"/> |
| <constructor-arg value="0"/> |
| <constructor-arg value="4"/> |
| </bean> |
| <bean id="string-decoder" class="org.jboss.netty.handler.codec.string.StringDecoder"/> |
| <!-- START SNIPPET: registry-beans --> |
| |
| </beans> |