Hey,
I've begun doing a messaging spike based on Camel, but it's gonna make
me age really fast... took me the better part of a day just to get it to
send an email, and getting it to output messages to Log4j is something I
still have not been able to do. Crazy shit.
On the one hand it would be nice to not have to do all the transports
that they've integrated, but on the other hand so far it is relly
frustrating to get it to work, and it brings in the entire Spring and
JAXB dependencies really fast.
All this being said, I have been able to create a MessageComposite which
holds Message state like this:
public interface MessageComposite
extends EntityComposite
{
Property<String> messageId();
Property<Map<String, Object>> headers();
Property<Map<String, DataHandler>> attachments();
Property<Object> body();
}
Sending a Message is done like so:
UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork();
try
{
EntityBuilder<MessageComposite> builder =
unitOfWork.newEntityBuilder( MessageComposite.class );
MessageComposite messageComposite = builder.newInstance();
messageComposite.body().set("Hello World");
Map<String, Object> headers = new HashMap<String, Object>( );
headers.put( "to", "[EMAIL PROTECTED]" );
headers.put( "subject", "testing" );
messageComposite.headers().set(headers);
unitOfWork.complete();
}
catch( Exception e )
{
unitOfWork.discard();
}
---
I.e. create a MessageComposite Entity and go, so the basic idea seems
ok. The EntityStore for messages has a concern that forwards them to
Camel. Works, but with all the above grey-hair-producing crap along with it.
So I'm not sure how to proceed really. Any thoughts?
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev