Hi Gert,

[resending , earlier mail had misplaced text ].

The purpose of my having a custom service engine is as follows :
1)The SE receives a message from the NMR.
2)Depending on the content of the message - say a few xml tags/contents in
the xml message ; the message will be written to a file , or sent as an
email (the to/from info will also be derived from the message text).

The origin of message is a POJO which can send an xml text.I don't want to
write a webservice client which sends a soap message to a BC in servicemix,
because that would incur an unnecessary network delay.

I would like a clarification on my understanding of SEs/BCs/SUs/SAs.
Servicemix has a lot of JBI components : some BindingComponents(like
servicemix-file) and some Service Engines (like servicemix-drools).The JBI
components perform generic tasks : e.g. servicemix-file : receives a message
from NMR and writes to a file. An SU for a JBI component such as
servicemix-file configures the servicemix-file BC with which specific file
to write the message into. An SU also serves to assign a "service name" (e.g
{http://mybc.com}myservice) to access the JBI component.Is my understanding
correct ?

So with the above premise , I was hoping to write an SE which performs the
actions described above to inspect message content to perform a File
operation or an email send. I also planned to write SUs/SAs for the
servicemix-file BC so as to assign a "service name" (a QName) to it. And
then write code in my SE to send a message to that service, to be able to
accomplish a file write operation.

I would be thankful if you could comment on my approach, and provide some
helpful pointers.

Thanks,
Eric. 



Gert Vanthienen wrote:
> 
> Eric,
> 
> The <file:sender/> you defined here already does exactly that: receiving 
> a message from the NMR and writing the contents to a file. So you 
> shouldn't be writing a SE to accomplish that.
> 
> Can you try to explain what you want your service engine to do?
> 
> Regards,
> 
> Gert
> 
> ericnygma wrote:
>> Hi Gert,
>>
>> Thanks a lot for the pointers.
>>
>> I was able to create the SU/SA for the servicemix-file component.
>> The xbean.xml for the SU described seems to talk about a file:sender and
>> a
>> file:poller service.The poller service is meant to pick up xml files from
>> a
>> specified directory and send them to the file:sender service which writes
>> them to a specified directory.
>>
>> I have this hello-world-se , which I wanted , upon receiving a text(xml)
>> message from the NMR , to write the text to a file , using the
>> servicemix-file component.So I assume I wont be needing a 'poller'
>> service.
>> So I wrote the xbean.xml to look as below :
>> <beans xmlns:file="http://servicemix.apache.org/file/1.0";
>>        xmlns:myfile="urn:myproject:file">
>>   <!-- add the sender endpoint here -->
>>   <file:sender service="myfile:file" 
>>              endpoint="sender"
>>              directory="file:///D:/space/myproj" />
>>   <!-- add the poller endpoint here -->    
>> </beans>
>>
>> Is this the right way to proceed, or am I hopelessly wrong.
>>
>> As of now, I have the unit test client (MySpringComponentTest) created
>> when
>> a service-engine is created with maven.This unit test client sends an xml
>> test to the hello-world-se.
>>
>> Thanks for the help again,
>> Eric.
>>
>>
>>
>>
>> Gert Vanthienen wrote:
>>   
>>> Eric,
>>>
>>>
>>> Our documentation sandbox contains two tutorials which are to be put on 
>>> the main site very soon.  One of them is about using Maven to build 
>>> SU/SA: 
>>> http://incubator.apache.org/servicemix/2-beginner-using-maven-to-develop-jbi-applications.html
>>>
>>> If you look at the tutorial, you'll notice that the examples in there 
>>> include a SU targeted at  servicemix-file.  Once you have the basic 
>>> structure, you can find even more configuration details on 
>>> http://incubator.apache.org/servicemix/servicemix-file.html
>>>
>>>
>>> Regards,
>>>
>>> Gert
>>>
>>> ericnygma wrote:
>>>     
>>>> Hi,
>>>>
>>>> I have a hello-world-se. I want it to write some text to a file.Towards
>>>> this, the following is my thinking:
>>>> 1) Create a service unit for the servicemix-file BC.
>>>> 2) Create a service assembly for the above su.Deploy it.
>>>> Now, I could find a tutorial on creating the su/sa for the
>>>> servicemix-http
>>>> component - through the use of a maven archetype. Is such an archetype
>>>> available for the servicemix-file component. I am asking this because I
>>>> dont
>>>> know what the jbi.xml and xbean.xml of the su/sa for the
>>>> servicemix-file
>>>> component should look like.
>>>>
>>>> Thanks in advance,
>>>> Eric.
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/creating-service-unit-and-service-assembly-for-service-file-component-tf4382975s12049.html#a12516539
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to