You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by cc...@apache.org on 2009/10/29 08:45:16 UTC

svn commit: r830856 - in /servicemix/smx4/features/trunk: ./ examples/loan-broker-bpel/ examples/loan-broker-bpel/client/ examples/loan-broker-bpel/client/src/ examples/loan-broker-bpel/client/src/main/ examples/loan-broker-bpel/client/src/main/java/ e...

Author: ccustine
Date: Thu Oct 29 07:45:15 2009
New Revision: 830856

URL: http://svn.apache.org/viewvc?rev=830856&view=rev
Log:
SMX4-51 Loan broker bpel demo fails in smx4

Added:
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/pom.xml
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/JMSClient.java
Removed:
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/build.xml
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/src/main/java/JMSClient.java
Modified:
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/loan-broker-jms-su/pom.xml
    servicemix/smx4/features/trunk/examples/loan-broker-bpel/pom.xml
    servicemix/smx4/features/trunk/pom.xml

Added: servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/pom.xml?rev=830856&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/pom.xml (added)
+++ servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/pom.xml Thu Oct 29 07:45:15 2009
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!--
+
+	 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.
+      -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix.examples</groupId>
+        <artifactId>loan-broker</artifactId>
+        <version>4.1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.examples.loan-broker</groupId>
+    <artifactId>loan-broker-jms-client</artifactId>
+    <name>ServiceMix :: Samples :: Loan Broker :: JMS Client</name>
+
+    <dependencies>
+	<dependency>
+	    <groupId>org.apache.activemq</groupId>
+	    <artifactId>activemq-core</artifactId>
+	    <version>${activemq.version}</version>
+	</dependency>
+	<dependency>
+	    <groupId>org.logicblaze.lingo</groupId>
+	    <artifactId>lingo</artifactId>
+	    <version>${lingo.version}</version>
+	    <exclusions>
+		<exclusion>
+		    <groupId>incubator-activemq</groupId>
+		    <artifactId>activeio-core</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>incubator-activemq</groupId>
+		    <artifactId>activemq-ra</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>incubator-activemq</groupId>
+		    <artifactId>activemq-core</artifactId>
+		</exclusion>
+	    </exclusions>
+	</dependency>
+    </dependencies>
+
+    <build>
+	<plugins>
+	    <plugin>
+		<groupId>org.codehaus.mojo</groupId>
+		<artifactId>exec-maven-plugin</artifactId>
+		<configuration>
+                    <mainClass>org.apache.servicemix.samples.loanbroker.JMSClient</mainClass>
+                    <includePluginDependencies>false</includePluginDependencies>
+		</configuration>
+            </plugin>
+	</plugins>
+    </build>
+</project>

Added: servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/JMSClient.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/JMSClient.java?rev=830856&view=auto
==============================================================================
--- servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/JMSClient.java (added)
+++ servicemix/smx4/features/trunk/examples/loan-broker-bpel/client/src/main/java/org/apache/servicemix/samples/loanbroker/JMSClient.java Thu Oct 29 07:45:15 2009
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.samples.loanbroker;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.logicblaze.lingo.jms.Requestor;
+import org.logicblaze.lingo.jms.JmsProducerConfig;
+import org.logicblaze.lingo.jms.impl.MultiplexingRequestor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.TextMessage;
+
+/**
+ * @version $Revision: 666120 $
+ */
+public class JMSClient implements Runnable {
+
+    private static ConnectionFactory factory;
+    private static CountDownLatch latch;
+    private static Requestor requestor;
+
+    /**
+     * main ...
+     * 
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+        System.out.println("Connecting to JMS server.");
+        factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
+        Destination inQueue = new ActiveMQQueue("demo.org.servicemix.source");
+        Destination outQueue = new ActiveMQQueue("demo.org.servicemix.output" + (int)(1000*Math.random()));
+        requestor = MultiplexingRequestor.newInstance(factory, new JmsProducerConfig(), inQueue, outQueue); 
+
+        if (args.length == 0) {
+            new JMSClient().run();
+        } else {
+            int nb = Integer.parseInt(args[0]);
+            int th = 30;
+            if (args.length > 1) {
+                th = Integer.parseInt(args[1]);
+            }
+            latch = new CountDownLatch(nb);
+            ExecutorService threadPool = Executors.newFixedThreadPool(th);
+            for (int i = 0; i < nb; i++) {
+                threadPool.submit(new JMSClient());
+            }
+            latch.await();
+        }
+        System.out.println("Closing.");
+        requestor.close();
+        System.exit(0);
+    }
+
+    public void run() {
+        try {
+            System.out.println("Sending request.");
+            double r = Math.random();
+
+            String request =
+                "<getLoanQuoteRequest xmlns='urn:logicblaze:soa:loanbroker'>\n" +
+                "  <ssn>102-24532-53254</ssn>\n" +
+                "  <amount>" + r * 100000 + "</amount>\n" +
+                "  <duration>" + (int) r * 48 + "</duration>\n" +
+                "  <score>" + (int) r * 48 + "</score>\n" +
+                "  <length>" + (int) r * 48 + "</length>\n" +
+                "</getLoanQuoteRequest>";
+
+            TextMessage out = requestor.getSession().createTextMessage(request);
+
+            TextMessage in = (TextMessage) requestor.request(null, out); 
+            if (in == null) {
+                System.out.println("Response timed out.");
+            }
+            else {
+                System.out.println("Response was: " + in.getText());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (latch != null) {
+                latch.countDown();
+            }
+        }
+    }
+
+}

Modified: servicemix/smx4/features/trunk/examples/loan-broker-bpel/loan-broker-jms-su/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/loan-broker-bpel/loan-broker-jms-su/pom.xml?rev=830856&r1=830855&r2=830856&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/loan-broker-bpel/loan-broker-jms-su/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/loan-broker-bpel/loan-broker-jms-su/pom.xml Thu Oct 29 07:45:15 2009
@@ -37,6 +37,41 @@
             <artifactId>servicemix-jms</artifactId>
             <version>${servicemix-jms-version}</version>
         </dependency>
+	<dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-pool</artifactId>
+            <version>${activemq.version}</version>
+	    <exclusions>
+		<exclusion>
+		    <groupId>org.apache.activemq.protobuf</groupId>
+		    <artifactId>activemq-protobuf</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>org.apache.activemq</groupId>
+		    <artifactId>kahadb</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>commons-logging</groupId>
+		    <artifactId>commons-logging-api</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>commons-net</groupId>
+		    <artifactId>commons-net</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>org.apache.geronimo.specs</groupId>
+		    <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>org.apache.geronimo.specs</groupId>
+		    <artifactId>geronimo-jms_1.1_spec</artifactId>
+		</exclusion>
+		<exclusion>
+		    <groupId>org.springframework</groupId>
+		    <artifactId>spring-beans</artifactId>
+		</exclusion>
+	    </exclusions>
+        </dependency>
     </dependencies>
 
     <build>
@@ -49,4 +84,4 @@
             </plugin>
         </plugins>
     </build>
-</project>
\ No newline at end of file
+</project>

Modified: servicemix/smx4/features/trunk/examples/loan-broker-bpel/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/loan-broker-bpel/pom.xml?rev=830856&r1=830855&r2=830856&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/loan-broker-bpel/pom.xml (original)
+++ servicemix/smx4/features/trunk/examples/loan-broker-bpel/pom.xml Thu Oct 29 07:45:15 2009
@@ -32,6 +32,9 @@
     <name>ServiceMix :: Samples :: Loan Broker</name>
     <packaging>pom</packaging>
     
+    <properties>
+	    <lingo.version>1.3</lingo.version>
+    </properties>
     <!-- Add ServiceMix repositories for snaphots and releases -->
     <pluginRepositories>
       <pluginRepository>
@@ -88,6 +91,7 @@
       <module>loan-broker-ode-su</module>
       <module>loan-broker-jms-su</module>
       <module>loan-broker-sa</module>
+	<module>client</module>
     </modules>
     
     <build>

Modified: servicemix/smx4/features/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/pom.xml?rev=830856&r1=830855&r2=830856&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/pom.xml (original)
+++ servicemix/smx4/features/trunk/pom.xml Thu Oct 29 07:45:15 2009
@@ -207,7 +207,7 @@
       <servicemix-camel-version>2009.02-SNAPSHOT</servicemix-camel-version>
       <servicemix-cxf-bc-version>2009.02-SNAPSHOT</servicemix-cxf-bc-version>
       <servicemix-cxf-se-version>2009.02-SNAPSHOT</servicemix-cxf-se-version>
-      <servicemix-drools-version>2009.01</servicemix-drools-version>
+      <servicemix-drools-version>2009.02-SNAPSHOT</servicemix-drools-version>
       <servicemix-file-version>2009.01</servicemix-file-version>
       <servicemix-snmp-version>2009.01</servicemix-snmp-version>
       <servicemix-smpp-version>2009.02-SNAPSHOT</servicemix-smpp-version>