INT-1380, added async-gateway sample, polishing others
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<import resource="classpath:META-INF/spring/integration/stub-services-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/loan-broker-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/bank-channel-mappings-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/shark-detector-config.xml"/>
|
||||
|
||||
</beans>
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<import resource="classpath:stub-services-config.xml" />
|
||||
<import resource="classpath:loan-broker-config.xml" />
|
||||
<import resource="classpath:bank-channel-mappings-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/stub-services-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/loan-broker-config.xml" />
|
||||
<import resource="classpath:META-INF/spring/integration/bank-channel-mappings-config.xml" />
|
||||
|
||||
</beans>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<import resource="classpath:stub-services-config.xml" />
|
||||
<import resource="classpath:loan-broker-config.xml" />
|
||||
<import resource="classpath:bank-channel-mappings-config.xml" />
|
||||
<import resource="classpath:shark-detector-config.xml"/>
|
||||
|
||||
</beans>
|
||||
@@ -41,7 +41,7 @@ public class LoanBrokerDemo {
|
||||
|
||||
@Test
|
||||
public void runDemo() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("bootstrap-config/stubbed-loan-broker.xml");
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/spring/integration/bootstrap-config/stubbed-loan-broker.xml");
|
||||
LoanBrokerGateway broker = context.getBean("loanBrokerGateway", LoanBrokerGateway.class);
|
||||
LoanRequest loanRequest = new LoanRequest();
|
||||
loanRequest.setCustomer(new Customer());
|
||||
|
||||
@@ -38,7 +38,7 @@ public class LoanBrokerSharkDetectorDemo {
|
||||
@Test
|
||||
public void testUdpMulticast() {
|
||||
ConfigurableApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("bootstrap-config/stubbed-loan-broker-multicast.xml");
|
||||
new ClassPathXmlApplicationContext("META-INF/spring/integration/bootstrap-config/stubbed-loan-broker-multicast.xml");
|
||||
LoanBrokerGateway broker = context.getBean("loanBrokerGateway", LoanBrokerGateway.class);
|
||||
LoanRequest loanRequest = new LoanRequest();
|
||||
loanRequest.setCustomer(new Customer());
|
||||
|
||||
12
case-studies/loan-broker/udps.groovy
Normal file
12
case-studies/loan-broker/udps.groovy
Normal file
@@ -0,0 +1,12 @@
|
||||
//Groovy Script to catch multicast packets.
|
||||
socket = new MulticastSocket(11111)
|
||||
mcast = InetAddress.getByName("225.6.7.8")
|
||||
socket.joinGroup(mcast)
|
||||
buffer = (' ' * 1024) as byte[]
|
||||
while(true) {
|
||||
incoming = new DatagramPacket(buffer, buffer.length)
|
||||
socket.receive(incoming)
|
||||
s = new String(incoming.data, 0, incoming.length)
|
||||
println ("** Shark **" + s)
|
||||
}
|
||||
|
||||
16
case-studies/loan-broker/udps.pl
Executable file
16
case-studies/loan-broker/udps.pl
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/perl -w
|
||||
#Perl Script to catch multicast packets.
|
||||
use strict;
|
||||
use IO::Socket::Multicast;
|
||||
|
||||
my $socket = IO::Socket::Multicast->new(LocalPort=>11111, ReuseAddr=>1)
|
||||
or die "Can't start UDP server: $@";
|
||||
|
||||
$socket->mcast_add('225.6.7.8');
|
||||
|
||||
my ($datagram,$flags);
|
||||
while ($socket->recv($datagram,1024,$flags)) {
|
||||
print "**Shark** $datagram\n";
|
||||
}
|
||||
|
||||
$socket->close();
|
||||
Reference in New Issue
Block a user