Guiseppe,
For a static configuration, you should create and install the SE as you
did before. Then, instead of creating SA/SU archive, you add the
necessary configuration directory to conf/servicemix.xml. On [1], you
can see how to add the ftp element to the <sm:activationSpecs/>. The
syntax for your own SE would be similar, just using another namespace.
For the goal you're trying to achieve (file from FTP -> handle message
in java code), you could also build a servicemix-lwcontainer SU. The SU
is configured using a servicemix.xml file instead of an xbean .xml file
(the syntax is shown at [2]. Have a look at [3] for an example on the
POJO class. If you use this approach, you do not need to build a
separate SE and install it, only a SA is required (because you only use
components that come out-of-the-box, together with ServiceMix).
Gert
[1]
http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-ftp/src/test/resources/spring.xml
[2] http://incubator.apache.org/servicemix/servicemix-lwcontainer.html
[2] http://incubator.apache.org/servicemix/pojo-support.html
beppe82 wrote:
Which would be the steps of creating, installing and deploying this simple
application using servicemix.xml?
Gert Vanthienen wrote:
You're right with regards to the xbean.xml and servicemix.xml file
usage. The only exception is a servicemix-lwcontainer SU, which also
contains a servicemix.xml config file instead of xbean.xml.
Gert
beppe82 wrote:
Thanks. So, using xbean.xml files for configuring SU is similar to write
servicemix.xml files for configuring the container and the components,
right? In the latter case I could personalize the container.... but from
a
component perspective it's quite the same, no?
Just another thing: at the end of your tutorial, I will get two SU, one
of
which depends over a SE (so, three folders) and one SA (another folder);
now, what do I copy to install directory and what to deploy? I try to
answer, correct me if I'm wrong: I will copy ZIP of SUs into install
(SE's
ZIP too???) and SA's JAR into deploy. And I would reach the same result
if I
would copy the ZIPs into install and then write mvn jbi:projectDeploy
into
SA directory, right?
Thanks, sorry for my English (I'm Italian) and for the simple
questions....
Gert Vanthienen wrote:
Guiseppe,
I'll try to give you a brief primer on what you should do to get this
result. If you just want to write a service to receive a message and do
something with it, you do not have to write your own service engine, you
can use the servicemix-lwcontainer or servicemix-bean component that is
included in the distribution and just build the SU/SA yourself. Anyway,
to get the SE example working...
First of all, the tutorial lets you build two things:
- a hello-world-se service engine (component), which is deployed by
copying it to ${servicemix.home}/install
- a hello-world-su service unit project
You have to add an xbean.xml file to your service unit project, to
describe the configuration for your service unit. Add an xbean.xml file
to hello-world-su/src/main/resources with this contents and rebuild the
project.
<beans
xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0"
xmlns:beppe="http://guiseppe.org">
<hello:endpoint service="beppe:service" endpoint="endpoint"/>
</beans>
Now, create a second service unit project, now containing this
xbean.xml:
<beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
xmlns:beppe="http://guiseppe.org">
<ftp:poller service="beppe:ftp" endpoint="poller"
targetService="beppe:service" targetEndpoint="endpoint"
uri="ftp://anonymous:[EMAIL PROTECTED]" />
</beans>
Afterwards, you should create another ZIP file (the service assembly),
containing both SU zip file and a file named META-INF/jbi.xml. For an
example of this file, have a look at
http://incubator.apache.org/servicemix/what-is-a-jbi-sa-and-how-do-i-create-one.html
(bottom of the page). Your file will contain two <service-unit/>
elements, one targeted towards the hello-world-se component, the other
uses servicemix-ftp.
Hope this helps,
Gert
beppe82 wrote:
Hi all, please help me because it's three days I'm wasting my time into
things that I think are not too difficult (but I can't do that!).
I have a simple SU, written following the tutorial about hello world
SE.
My
process() method just receive a "in" message, print a phrase (using
System.out.println(...)... can I use this method to write on standard
output?) and sets exchange status to "done". I'd like to use it
together
with the ready component ftp-poller... can you write me a step-by-step
guide
to do that? I'm not able to integrate, build and deploy this very
simple
application... I'm a bit confused about using maven, or using ant,
using
servicexml.xml... I don't exactly know what to do! Thank you very much,
Giuseppe