Move main to version 6.0
* Upgrade to the latest dependencies * Migrate samples to `jakarta` namespace * Rework `cafe-scripted` to RSocket instead of already removed RMI * Migrate JMS samples to Apache Artemis for Jakarta EE 9 * Disables mails tests since there is a requirement to migrate to Greenmail for Jakarta EE 9 support * Rework `generatePom` task to a new `maven-publish` plugin style
This commit is contained in:
@@ -39,8 +39,8 @@ public class Waiter {
|
||||
}
|
||||
|
||||
@ManagedOperation
|
||||
public int getTotalDeliveries() {
|
||||
return this.totalDeliveries.get();
|
||||
public String getTotalDeliveries() {
|
||||
return this.totalDeliveries.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,13 @@ package org.springframework.integration.samples.cafe;
|
||||
|
||||
/**
|
||||
* Send a groovy script to the control bus and return the result
|
||||
*
|
||||
* @author David Turanski
|
||||
*
|
||||
* @author Artem Bilan
|
||||
*
|
||||
*/
|
||||
public interface WaiterMonitor {
|
||||
Object sendControlScript(String script);
|
||||
|
||||
Integer sendControlScript(String script);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CafeDemoApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
List<String> languages = Arrays.asList(new String[]{"groovy","ruby","javascript","python"});
|
||||
List<String> languages = Arrays.asList(new String[]{"groovy","ruby","python"});
|
||||
if (args.length != 1) {
|
||||
usage();
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class CafeDemoApp {
|
||||
|
||||
|
||||
private static void usage() {
|
||||
System.out.println("missing or invalid commannd line argument [groovy,ruby,javascript,python]");
|
||||
System.out.println("missing or invalid command line argument [groovy,ruby,python]");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ControlBusMain {
|
||||
logger.error("Interrupted", e);
|
||||
}
|
||||
|
||||
totalDeliveries = (Integer)waiterMonitor.sendControlScript("waiter.totalDeliveries");
|
||||
totalDeliveries = waiterMonitor.sendControlScript("waiter.totalDeliveries");
|
||||
|
||||
logger.info("Total cafe deliveries: " + totalDeliveries);
|
||||
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:groovy="http://www.springframework.org/schema/integration/groovy"
|
||||
xmlns:rmi="http://www.springframework.org/schema/integration/rmi"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/rmi https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd
|
||||
http://www.springframework.org/schema/integration/groovy https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd
|
||||
xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:int-rsocket="http://www.springframework.org/schema/integration/rsocket"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/rsocket https://www.springframework.org/schema/integration/rsocket/spring-integration-rsocket.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<beans:description>
|
||||
This is the application context for ControlBusMain. It configures a Gateway tied to an RMI outbound gateway to communicate
|
||||
remotely with the CafeDemoApp.
|
||||
</beans:description>
|
||||
|
||||
|
||||
<gateway id="waiterMonitor"
|
||||
service-interface="org.springframework.integration.samples.cafe.WaiterMonitor">
|
||||
<method name="sendControlScript" request-channel="controlBusInput" request-timeout="1000" reply-timeout="1000"/>
|
||||
</gateway>
|
||||
|
||||
<rmi:outbound-gateway
|
||||
request-channel="controlBusInput"
|
||||
remote-channel="controlBusInput"
|
||||
reply-timeout="1000"
|
||||
request-timeout="1000"
|
||||
host="localhost"/>
|
||||
|
||||
<beans:description>
|
||||
This is the application context for ControlBusMain. It configures a Gateway tied to an RMI outbound gateway to
|
||||
communicate
|
||||
remotely with the CafeDemoApp.
|
||||
</beans:description>
|
||||
|
||||
|
||||
<gateway id="waiterMonitor"
|
||||
service-interface="org.springframework.integration.samples.cafe.WaiterMonitor">
|
||||
<method name="sendControlScript" request-channel="controlBusInput" request-timeout="1000" reply-timeout="1000"/>
|
||||
</gateway>
|
||||
|
||||
<beans:bean id="clientRSocketConnector" class="org.springframework.integration.rsocket.ClientRSocketConnector">
|
||||
<beans:constructor-arg value="localhost"/>
|
||||
<beans:constructor-arg value="7777"/>
|
||||
</beans:bean>
|
||||
|
||||
<int-rsocket:outbound-gateway
|
||||
request-channel="controlBusInput"
|
||||
client-rsocket-connector="clientRSocketConnector"
|
||||
route="controlBus"/>
|
||||
|
||||
</beans:beans>
|
||||
|
||||
@@ -1,83 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:groovy="http://www.springframework.org/schema/integration/groovy"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:rmi="http://www.springframework.org/schema/integration/rmi"
|
||||
xmlns:stream="http://www.springframework.org/schema/integration/stream"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/rmi https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:groovy="http://www.springframework.org/schema/integration/groovy"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:int-rsocket="http://www.springframework.org/schema/integration/rsocket"
|
||||
xmlns:stream="http://www.springframework.org/schema/integration/stream"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/rsocket https://www.springframework.org/schema/integration/rsocket/spring-integration-rsocket.xsd
|
||||
http://www.springframework.org/schema/integration/stream https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
|
||||
http://www.springframework.org/schema/integration/groovy https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<beans:description>
|
||||
This is the application context for the scripted implementation of CafeDemoApp. The functionality is basically
|
||||
identical to the original CafeDemoApp.
|
||||
|
||||
In order to demonstrate the Groovy control bus, the original cafe Gateway is replaced with an
|
||||
inbound-channel-adapter (which supports the SmartLifeCycle interface).
|
||||
|
||||
The inbound-channel-adapter is backed by a Customer bean which provides the orders.
|
||||
|
||||
This configuration also uses Spring 3.1 environment profiles to inject a configuration specific to the
|
||||
selected scripting language.
|
||||
</beans:description>
|
||||
|
||||
<beans:beans>
|
||||
<rmi:inbound-gateway request-channel="controlBusInput"
|
||||
reply-channel="controlBusOutput" />
|
||||
|
||||
<groovy:control-bus input-channel="controlBusInput"
|
||||
output-channel="controlBusOutput" />
|
||||
<beans:description>
|
||||
This is the application context for the scripted implementation of CafeDemoApp. The functionality is basically
|
||||
identical to the original CafeDemoApp.
|
||||
|
||||
<channel id="controlBusOutput" />
|
||||
|
||||
<inbound-channel-adapter id="cafe" channel="orders"
|
||||
ref="customer" method="getOrder" />
|
||||
In order to demonstrate the Groovy control bus, the original cafe Gateway is replaced with an
|
||||
inbound-channel-adapter (which supports the SmartLifeCycle interface).
|
||||
|
||||
<beans:bean id="customer"
|
||||
class="org.springframework.integration.samples.cafe.Customer" />
|
||||
The inbound-channel-adapter is backed by a Customer bean which provides the orders.
|
||||
|
||||
<channel id="orders" />
|
||||
This configuration also uses Spring 3.1 environment profiles to inject a configuration specific to the
|
||||
selected scripting language.
|
||||
</beans:description>
|
||||
|
||||
<channel id="coldDrinks">
|
||||
<queue capacity="10" />
|
||||
</channel>
|
||||
<beans:beans>
|
||||
|
||||
<channel id="hotDrinks">
|
||||
<queue capacity="10" />
|
||||
</channel>
|
||||
<beans:bean id="rSocketConnector" class="org.springframework.integration.rsocket.ServerRSocketConnector">
|
||||
<beans:constructor-arg value="localhost"/>
|
||||
<beans:constructor-arg value="7777"/>
|
||||
</beans:bean>
|
||||
|
||||
<!-- Aggregator does not currently support scripting -->
|
||||
<aggregator input-channel="preparedDrinks" method="prepareDelivery"
|
||||
output-channel="deliveries" ref="waiter" />
|
||||
<int-rsocket:inbound-gateway path="controlBus" request-channel="rsocketRequest"/>
|
||||
|
||||
<beans:bean id="waiter"
|
||||
class="org.springframework.integration.samples.cafe.Waiter" />
|
||||
<service-activator input-channel="rsocketRequest" output-channel="controlBusInput" async="true" expression="payload"/>
|
||||
|
||||
<stream:stdout-channel-adapter id="deliveries" />
|
||||
<beans:bean id="controlBusInput" class="org.springframework.integration.channel.FluxMessageChannel"/>
|
||||
|
||||
<poller id="poller" default="true" fixed-delay="1000" />
|
||||
<groovy:control-bus input-channel="controlBusInput"/>
|
||||
|
||||
</beans:beans>
|
||||
<inbound-channel-adapter id="cafe" channel="orders"
|
||||
ref="customer" method="getOrder"/>
|
||||
|
||||
<beans:beans profile="groovy">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-groovy.xml" />
|
||||
</beans:beans>
|
||||
<beans:bean id="customer"
|
||||
class="org.springframework.integration.samples.cafe.Customer"/>
|
||||
|
||||
<beans:beans profile="ruby">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-ruby.xml" />
|
||||
</beans:beans>
|
||||
<channel id="orders"/>
|
||||
|
||||
<beans:beans profile="javascript">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-javascript.xml" />
|
||||
</beans:beans>
|
||||
<channel id="coldDrinks">
|
||||
<queue capacity="10"/>
|
||||
</channel>
|
||||
|
||||
<beans:beans profile="python">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-python.xml" />
|
||||
</beans:beans>
|
||||
<channel id="hotDrinks">
|
||||
<queue capacity="10"/>
|
||||
</channel>
|
||||
|
||||
<!-- Aggregator does not currently support scripting -->
|
||||
<aggregator input-channel="preparedDrinks" method="prepareDelivery"
|
||||
output-channel="deliveries" ref="waiter"/>
|
||||
|
||||
<beans:bean id="waiter"
|
||||
class="org.springframework.integration.samples.cafe.Waiter"/>
|
||||
|
||||
<stream:stdout-channel-adapter id="deliveries"/>
|
||||
|
||||
<poller id="poller" default="true" fixed-delay="1000"/>
|
||||
|
||||
</beans:beans>
|
||||
|
||||
<beans:beans profile="groovy">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-groovy.xml"/>
|
||||
</beans:beans>
|
||||
|
||||
<beans:beans profile="ruby">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-ruby.xml"/>
|
||||
</beans:beans>
|
||||
|
||||
<beans:beans profile="javascript">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-javascript.xml"/>
|
||||
</beans:beans>
|
||||
|
||||
<beans:beans profile="python">
|
||||
<beans:import
|
||||
resource="classpath:META-INF/spring/integration/cafeDemo-python.xml"/>
|
||||
</beans:beans>
|
||||
|
||||
</beans:beans>
|
||||
|
||||
Reference in New Issue
Block a user