This file contains hidden or 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
/** | |
* 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 | |
* |
This file contains hidden or 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
/** | |
* 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 | |
* |
This file contains hidden or 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
package posta; | |
import org.apache.activemq.broker.BrokerService; | |
import org.apache.activemq.camel.component.ActiveMQComponent; | |
import org.apache.activemq.camel.component.ActiveMQConfiguration; | |
import org.apache.activemq.xbean.BrokerFactoryBean; | |
import org.apache.camel.CamelContext; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.Message; | |
import org.apache.camel.Processor; |
This file contains hidden or 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
package posta; | |
import org.apache.activemq.broker.BrokerService; | |
import org.apache.activemq.camel.component.ActiveMQComponent; | |
import org.apache.activemq.camel.component.ActiveMQConfiguration; | |
import org.apache.activemq.xbean.BrokerFactoryBean; | |
import org.apache.camel.CamelContext; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.Message; | |
import org.apache.camel.Processor; |
This file contains hidden or 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
<int:gateway id="cafe" service-interface="org.springframework.integration.samples.cafe.Cafe"/> | |
<!-- each order has a collection of order items that is split apart to be processed --> | |
<int:channel id="orders"/> | |
<int:splitter input-channel="orders" expression="payload.items" output-channel="drinks"/> | |
<!-- The router sends different drink orders on different paths --> | |
<int:channel id="drinks"/> | |
<int:router input-channel="drinks" expression="payload.iced ? 'coldDrinks' : 'hotDrinks'"/> |
This file contains hidden or 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
public void configure() { | |
from("direct:cafe") | |
.split().method("orderSplitter") | |
.to("direct:drink"); | |
from("direct:drink").recipientList().method("drinkRouter"); | |
from("seda:coldDrinks?concurrentConsumers=2") | |
.to("bean:barista?method=prepareColdDrink") |
This file contains hidden or 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
<int:gateway id="cafe" service-interface="org.springframework.integration.samples.cafe.Cafe"/> | |
<!-- each order has a collection of order items that is split apart to be processed --> | |
<int:channel id="orders"/> | |
<int:splitter input-channel="orders" expression="payload.items" output-channel="drinks"/> | |
<!-- The router sends different drink orders on different paths --> | |
<int:channel id="drinks"/> | |
<int:router input-channel="drinks" expression="payload.iced ? 'coldDrinks' : 'hotDrinks'"/> |
This file contains hidden or 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
MockEndpoint resultEndpoint = context.resolveEndpoint("mock:foo", MockEndpoint.class); | |
resultEndpoint.setAssertPeriod(5000); | |
resultEndpoint.expectedMessageCount(2); | |
// send some messages | |
... | |
// now lets assert that the mock:foo endpoint received 2 messages | |
resultEndpoint.assertIsSatisfied(); |
This file contains hidden or 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
context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
// mock sending to direct:foo and direct:bar and skip send to it | |
mockEndpointsAndSkip("direct:foo", "direct:bar"); | |
} | |
}); |
This file contains hidden or 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
<plugins> | |
<bean xmlns="http://www.springframework.org/schema/beans" | |
id="loggingPlugin" | |
class="org.apache.activemq.broker.util.LoggingBrokerPlugin" | |
/> | |
</plugins> |
OlderNewer