Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • an HTTP+SOAP consumer
  • a routing slip to call the XSLT transformer and the JMS provider
  • an XSLT transformer
  • a JMS provider

Creating the project structure

Directory layout

We aim to have the following project structure:

Code Block
bridge\
  pom.xml
  bridge-http-su\
    ...
  bridge-eip-su\
    ...
  bridge-xslt-su\
    ...
  bridge-jms-su\
    ...
  bridge-sa\
    ...

Creating the archetypes

In the bridge directory, run the following commands:

Code Block
mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-http-consumer-service-unit \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.samples.bridge \
        -DartifactId=bridge-http-su

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-jms-provider-service-unit \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.samples.bridge \
        -DartifactId=bridge-jms-su

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-service-unit \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.samples.bridge \
        -DartifactId=bridge-eip-su

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-service-unit \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.samples.bridge \
        -DartifactId=bridge-xslt-su

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-service-assembly \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.samples.bridge \
        -DartifactId=bridge-sa

Main pom

Now that we have created the SUs and SA structure, let's write the main pom:

Code Block
langxml
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.servicemix.samples</groupId>
  <artifactId>bridge</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
    <module>bridge-http-su</module>
    <module>bridge-eip-su</module>
    <module>bridge-xslt-su</module>
    <module>bridge-sa-su</module>
  </modules>
</project>

Configure the Service Assembly

We want the Service Assembly to include the 4 SUs that we just created.
So let's edit the pom and change the dependencies to:

Code Block
langxml

<dependencies>
  <dependency>
    <groupId>org.apache.servicemix.samples.bridge</groupId>
    <artifactId>bridge-http-su</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.apache.servicemix.samples.bridge</groupId>
    <artifactId>bridge-http-eip</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.apache.servicemix.samples.bridge</groupId>
    <artifactId>bridge-http-xslt</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.apache.servicemix.samples.bridge</groupId>
    <artifactId>bridge-http-jms</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
</dependencies>

Now, we should be able to launch maven and have a the SA generated in the bridge-sa/target/ directory. Of course, it won't work if you deploy it and we now need to fill the holes.