You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Benamin <be...@bisonline.com> on 2007/04/10 21:32:10 UTC

How to send messages between service units

I have built a service engine that does some stuff, and I have added an http
consumer service unit.  My xbean configuration for the http piece is as
follows:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:replaceMe="http://servicemix.apache.org/samples/MyTest">

  <http:endpoint service="b:MyTest"
                 endpoint="endpoint"
                 role="consumer" 
                 locationURI="http://0.0.0.0:8192/MyTest/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
                 soap="true" />             

</beans>

I assume I need to add the targetService to forward my request to my service
engine, but I am not sure how to specify this.  I assumed I needed to make a
service unit that depends on my service engine.  I kind of expected to have
an xbean file there in the service unit, but I didn't see one.  So how do I
specify the name of my service unit?  I figured this name would go into my
targetService for the http component?

Also, I don't know what the namespace is in the http xbean when you are
specifying the service.  Can somebody explain what the namespace should be?


-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a9926770
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.


gc y wrote:
> 
> Give me your email, I'll give you a complete example.
> 

My email is benold79@gmail.com.  Thanks for your help.

-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10269128
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Guillaume Nodet <gn...@gmail.com>.
Maybe you could attach to a JIRA ? We could create a wiki page for it if you
want to donate it
to the community.

On 4/28/07, gc y <xg...@tom.com> wrote:
>
>
> Give me your email, I'll give you a complete example.
> --
> View this message in context:
> http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10230502
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: How to send messages between service units

Posted by gc y <xg...@tom.com>.
Give me your email, I'll give you a complete example.
-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10230502
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.


>> I tried just dropping the jar file that is made when I compile the
>> MyTest-su-se into the deploy dir, but I get errors, so I assume that is
>> not
>> the correct way to fix my problem.
>>
>> My error says "Unable to find jbi descriptor:
>> deploy/MyTest-su-se-1.0-SNAPSHOT.jar"
>>
>> Any ideas on how to fix my problem of the SA not deploying?

>Does the JAR file contain a directory named META-INF that contains a
>jbi.xml file? Based on the error above, it cannot find such a file.
>The META-INF/jbi.xml file is created for you by the jbi-maven-plugin
>when building with Maven. Are you building the project with Maven? If
>so, please post the <build> section from the pom.xml.

It doesn't look like there is a jbi.xml in the META-INF directory.  Here is
the build section from the pom.xml.


<build>
    <plugins>
      <plugin>
        <groupId>org.apache.servicemix.tooling</groupId>
        <artifactId>jbi-maven-plugin</artifactId>   
        <version>${servicemix-version}</version>     
        <extensions>true</extensions>
        <configuration>
          <type>service-engine</type>
         
<bootstrap>org.apache.servicemix.samples.MyTest.MyBootstrap</bootstrap>
         
<component>org.apache.servicemix.samples.MyTest.MyComponent</component>
          <deployDependencies>false</deployDependencies>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.xbean</groupId>
        <artifactId>maven-xbean-plugin</artifactId>
        <version>${xbean-version}</version>
        <executions>
          <execution>
            <configuration>
             
<namespace>http://org.apache.servicemix.samples.MyTest/1.0</namespace>
            </configuration>
            <goals>
              <goal>mapping</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10186369
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Bruce Snyder <br...@gmail.com>.
On 4/18/07, Benamin <be...@bisonline.com> wrote:
>
> I tried just dropping the jar file that is made when I compile the
> MyTest-su-se into the deploy dir, but I get errors, so I assume that is not
> the correct way to fix my problem.
>
> My error says "Unable to find jbi descriptor:
> deploy/MyTest-su-se-1.0-SNAPSHOT.jar"
>
> Any ideas on how to fix my problem of the SA not deploying?

Does the JAR file contain a directory named META-INF that contains a
jbi.xml file? Based on the error above, it cannot find such a file.
The META-INF/jbi.xml file is created for you by the jbi-maven-plugin
when building with Maven. Are you building the project with Maven? If
so, please post the <build> section from the pom.xml.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.
I tried just dropping the jar file that is made when I compile the
MyTest-su-se into the deploy dir, but I get errors, so I assume that is not
the correct way to fix my problem.

My error says "Unable to find jbi descriptor:
deploy/MyTest-su-se-1.0-SNAPSHOT.jar"

Any ideas on how to fix my problem of the SA not deploying?



Benamin wrote:
> 
> I have a problem, that I just now noticed.  When I attempt to deploy my
> SA, it give this message:
> 
> "WARN  - AutoDeploymentService          - Components MyTest-su-se are not
> installed yet: the service assembly MyTest-sa deployment is suspended and
> will be resumed once the listed components are installed."
> 
> This was supposed to be my su for the MyTest-se I created.  I configured
> an xbean.xml for it and ran mvn install inside the MyTest-su-se directory. 
> Is there something else I need to do?
> 

-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10065050
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.


>> I have a problem, that I just now noticed.  When I attempt to deploy my
>> SA,
>> it give this message:
>>
>> "WARN  - AutoDeploymentService          - Components MyTest-su-se are not
>> installed yet: the service assembly MyTest-sa deployment is suspended and
>> will be resumed once the listed components are installed."
>>
>> This was supposed to be my su for the MyTest-se I created.  I configured
>> an
>> xbean.xml for it and ran mvn install inside the MyTest-su-se directory. 
>> Is
>> there something else I need to do?

> This warning is telling you that the component being deployed doesn't
> have all of it's dependencies so the deployment is being suspended
> until its dependencies are provided. Is the MyTest-se deployed
> already?


I don't think it is deployed.  If I place the MyTest-se jar into the deploy
directory, I get errors.  Is it supposed to be placed somewhere else to
deploy it?
-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10186517
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Bruce Snyder <br...@gmail.com>.
On 4/16/07, Benamin <be...@bisonline.com> wrote:
>
> I have a problem, that I just now noticed.  When I attempt to deploy my SA,
> it give this message:
>
> "WARN  - AutoDeploymentService          - Components MyTest-su-se are not
> installed yet: the service assembly MyTest-sa deployment is suspended and
> will be resumed once the listed components are installed."
>
> This was supposed to be my su for the MyTest-se I created.  I configured an
> xbean.xml for it and ran mvn install inside the MyTest-su-se directory.  Is
> there something else I need to do?

This warning is telling you that the component being deployed doesn't
have all of it's dependencies so the deployment is being suspended
until its dependencies are provided. Is the MyTest-se deployed
already?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.
I have a problem, that I just now noticed.  When I attempt to deploy my SA,
it give this message:

"WARN  - AutoDeploymentService          - Components MyTest-su-se are not
installed yet: the service assembly MyTest-sa deployment is suspended and
will be resumed once the listed components are installed."

This was supposed to be my su for the MyTest-se I created.  I configured an
xbean.xml for it and ran mvn install inside the MyTest-su-se directory.  Is
there something else I need to do?
-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a10021132
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Bruce Snyder <br...@gmail.com>.
On 4/11/07, Benamin <be...@bisonline.com> wrote:

> What I would expect to see is a list of available services.  All I want to
> do is be able to send a SOAP request (like what the bridge example sends in
> the client.html) which contains some xml data.  Then forward that xml data
> from the http su to my su that wraps my se.  The se then does the rest of
> the work.  I thought by sending the xml data from the http su to the su that
> wraps the se that the data would arrive at the MyEndpoint::processInOut()
> method for my se.  Is that right?

There is no list of all available services because message routing
occurs using the service name, interface name or endpoint name. As for
your HTTP consumer, it is exposed on http://localhost:8192/MyTest. The
only thing you need to do is send a message to it at that URL. The
easiest type of message to send is SOAP. Just make sure that
soap="true" is added to the HTTP consumer configuration so that it
will accept SOAP messages. After enabling that, just use SoapUI to
point at the HTTP consumer URL and help you to generate a SOAP message
to send to it. SoapUI makes it really easy.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.
>> Can you show me what this xbean.xml file for the SU that wraps my SE
should
>> look like?

> It's completely dependent upon the implementation of your SE. At a
> minimum you'll need to define a namespace, provide a service name and
> an endpoint name. Beyond that it's dependent upon the parameters that
> are exposed by your SE that will need to be configured.

>> My new configuration for the http su looks like this:
>>
>> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>        xmlns:test="http://servicemix.apache.org/samples/MyTest">
>>
>> <!-- add this to config: targetService="Endpoint_Of_SU_That_Wraps_SE" -->
>>   <http:endpoint service="test:http"
>>                  endpoint="endpoint"
>>                  role="consumer"
>>                  locationURI="http://0.0.0.0:8192/MyTest/"
>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
>>
>> </beans>
>>
>> I attempt to deploy this using an SA, and ServiceMix provides a message
>> saying the SA was deployed, but if I browse to localhost:8192, I do not
>> see
>> my service available.  Any thing I can look for to see why it might not
>> be
>> available?

> What are you expecting to see when you visit http://localhost:8192?

What I would expect to see is a list of available services.  All I want to
do is be able to send a SOAP request (like what the bridge example sends in
the client.html) which contains some xml data.  Then forward that xml data
from the http su to my su that wraps my se.  The se then does the rest of
the work.  I thought by sending the xml data from the http su to the su that
wraps the se that the data would arrive at the MyEndpoint::processInOut()
method for my se.  Is that right?
-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a9943325
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Bruce Snyder <br...@gmail.com>.
On 4/11/07, Benamin <be...@bisonline.com> wrote:

> Can you show me what this xbean.xml file for the SU that wraps my SE should
> look like?

It's completely dependent upon the implementation of your SE. At a
minimum you'll need to define a namespace, provide a service name and
an endpoint name. Beyond that it's dependent upon the parameters that
are exposed by your SE that will need to be configured.

> My new configuration for the http su looks like this:
>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:test="http://servicemix.apache.org/samples/MyTest">
>
> <!-- add this to config: targetService="Endpoint_Of_SU_That_Wraps_SE" -->
>   <http:endpoint service="test:http"
>                  endpoint="endpoint"
>                  role="consumer"
>                  locationURI="http://0.0.0.0:8192/MyTest/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
>
> </beans>
>
> I attempt to deploy this using an SA, and ServiceMix provides a message
> saying the SA was deployed, but if I browse to localhost:8192, I do not see
> my service available.  Any thing I can look for to see why it might not be
> available?

What are you expecting to see when you visit http://localhost:8192?
There won't be a web page available on that URL, the HTTP SU will be
waiting for messages to be sent to it via that URL. One typical manner
of testing a component is to use SoapUI to send SOAP messages. But
this will only work if your component can handle SOAP messages or you
have components wired into the flow that can handle SOAP messages and
transform them into something that your component can handle.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: How to send messages between service units

Posted by Benamin <be...@bisonline.com>.


On 4/10/07, Benamin <be...@bisonline.com> wrote:
>>
>> I have built a service engine that does some stuff, and I have added an
>> http
>> consumer service unit.  My xbean configuration for the http piece is as
>> follows:
>>
>> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>        xmlns:replaceMe="http://servicemix.apache.org/samples/MyTest">
>>
>>   <http:endpoint service="b:MyTest"
>>                  endpoint="endpoint"
>>                  role="consumer"
>>                  locationURI="http://0.0.0.0:8192/MyTest/"
>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>>                  soap="true" />
>>
>> </beans> 

>> I assumed I needed to make a
>> service unit that depends on my service engine.  I kind of expected to
>> have
>> an xbean file there in the service unit, but I didn't see one.

> Yes, if you have created your own SE, then you will need to create a
> SU that depends on that SE and the SU will contain the xbean.xml
> configuration file.

Can you show me what this xbean.xml file for the SU that wraps my SE should
look like?

My new configuration for the http su looks like this:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:test="http://servicemix.apache.org/samples/MyTest">

<!-- add this to config: targetService="Endpoint_Of_SU_That_Wraps_SE" -->
  <http:endpoint service="test:http"
                 endpoint="endpoint"
                 role="consumer" 
                 locationURI="http://0.0.0.0:8192/MyTest/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />             

</beans>

I attempt to deploy this using an SA, and ServiceMix provides a message
saying the SA was deployed, but if I browse to localhost:8192, I do not see
my service available.  Any thing I can look for to see why it might not be
available?



-- 
View this message in context: http://www.nabble.com/How-to-send-messages-between-service-units-tf3555183s12049.html#a9941279
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to send messages between service units

Posted by Bruce Snyder <br...@gmail.com>.
On 4/10/07, Benamin <be...@bisonline.com> wrote:
>
> I have built a service engine that does some stuff, and I have added an http
> consumer service unit.  My xbean configuration for the http piece is as
> follows:
>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:replaceMe="http://servicemix.apache.org/samples/MyTest">
>
>   <http:endpoint service="b:MyTest"
>                  endpoint="endpoint"
>                  role="consumer"
>                  locationURI="http://0.0.0.0:8192/MyTest/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>                  soap="true" />
>
> </beans>

I see you've named the service b:MyTest but there is no b namespace in
the configuration. For this SU to be deployed successfully, you'll
need to add the b namespace to the configuration and then wrap the SU
in a SA.

> I assume I need to add the targetService to forward my request to my service
> engine, but I am not sure how to specify this.

Yes, to route messages from the HTTP consumer, you will use either the
targetService, the targetEndpoint or the targetInterface attribute.

> I assumed I needed to make a
> service unit that depends on my service engine.  I kind of expected to have
> an xbean file there in the service unit, but I didn't see one.

Yes, if you have created your own SE, then you will need to create a
SU that depends on that SE and the SU will contain the xbean.xml
configuration file.

> So how do I
> specify the name of my service unit?  I figured this name would go into my
> targetService for the http component?

The name of the SU is stated in the pom.xml for the Maven project
containing the xbean.xml configuration. The JBI Maven Plugin processes
both the pom.xml and the xbean.xml files to produce the jbi.xml
descriptor for the SU. Then the SU will need to be wrapped in a SA in
order to be deployed.

> Also, I don't know what the namespace is in the http xbean when you are
> specifying the service.  Can somebody explain what the namespace should be?

You select your own namespace. It can be anything as long as it's
compliant. As a point of reference, see the example namespace above
whose name is replaceMe.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/