Updated the annotation-based Cafe Demo to use a bridge element since the annotated-methods in Barista now require a SubscribableChannel.
This commit is contained in:
@@ -47,7 +47,7 @@ public class Barista {
|
||||
this.coldDrinkDelay = coldDrinkDelay;
|
||||
}
|
||||
|
||||
@ServiceActivator(inputChannel="hotDrinks", outputChannel="preparedDrinks")
|
||||
@ServiceActivator(inputChannel="hotDrinkBarista", outputChannel="preparedDrinks")
|
||||
public Drink prepareHotDrink(OrderItem orderItem) {
|
||||
try {
|
||||
Thread.sleep(this.hotDrinkDelay);
|
||||
@@ -62,7 +62,7 @@ public class Barista {
|
||||
}
|
||||
}
|
||||
|
||||
@ServiceActivator(inputChannel="coldDrinks", outputChannel="preparedDrinks")
|
||||
@ServiceActivator(inputChannel="coldDrinkBarista", outputChannel="preparedDrinks")
|
||||
public Drink prepareColdDrink(OrderItem orderItem) {
|
||||
try {
|
||||
Thread.sleep(this.coldDrinkDelay);
|
||||
|
||||
@@ -21,17 +21,24 @@
|
||||
|
||||
<channel id="orders"/>
|
||||
<channel id="drinks"/>
|
||||
|
||||
<channel id="coldDrinks">
|
||||
<queue capacity="10"/>
|
||||
</channel>
|
||||
|
||||
<channel id="hotDrinks">
|
||||
<queue capacity="10"/>
|
||||
</channel>
|
||||
|
||||
<channel id="coldDrinks"><queue capacity="10"/></channel>
|
||||
<channel id="hotDrinks"><queue capacity="10"/></channel>
|
||||
<channel id="coldDrinkBarista"/>
|
||||
<channel id="hotDrinkBarista"/>
|
||||
<channel id="preparedDrinks"/>
|
||||
|
||||
<bridge input-channel="coldDrinks" output-channel="coldDrinkBarista">
|
||||
<poller>
|
||||
<interval-trigger interval="1000"/>
|
||||
</poller>
|
||||
</bridge>
|
||||
|
||||
<bridge input-channel="hotDrinks" output-channel="hotDrinkBarista">
|
||||
<poller>
|
||||
<interval-trigger interval="1000"/>
|
||||
</poller>
|
||||
</bridge>
|
||||
|
||||
<stream:stdout-channel-adapter id="deliveries"/>
|
||||
|
||||
</beans:beans>
|
||||
|
||||
Reference in New Issue
Block a user