I use exactly the same environment as Anders Hammar, and when I want to send
a message to a component I usually do something like this example below:
package com.test;
import java.util.Date;
import javax.jbi.JBIException;
import javax.jbi.component.ComponentContext;
import javax.jbi.messaging.InOnly;
import javax.jbi.messaging.MessagingException;
import javax.jbi.messaging.NormalizedMessage;
import javax.xml.namespace.QName;
import org.apache.servicemix.client.RemoteServiceMixClient;
public class SMTest {
/**
* @param args
*/
public static void main(String[] args) {
org.apache.servicemix.client.RemoteServiceMixClient cl = new
RemoteServiceMixClient("tcp://10.0.0.2:61616");
try {
cl.init();
cl.start();
} catch (JBIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ComponentContext ctx = cl.getContext();
try {
InOnly me = cl.createInOnlyExchange();
me.setService(new QName("http://test/1.0", "MailSender","foo"));
NormalizedMessage message = me.getInMessage();
message.setProperty("org.apache.servicemix.email.to", "[EMAIL PROTECTED]");
message.setProperty("org.apache.servicemix.email.from", "[EMAIL PROTECTED]
");
message.setProperty("org.apache.servicemix.email.subject", "Hello
servicemix");
message.setProperty("org.apache.servicemix.email.text", "hi");
cl.send(me);
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
On 2/17/07, Anders Hammar <[EMAIL PROTECTED]> wrote:
They way we used smx in development was to use Eclipse for the actual
development, but using Maven to build and deploy to smx (via the smx maven
plugin). For debugging I used remote debugging from Eclipse (you need to
start smx with the SERVICEMIX_DEBUG env variable set, see servicemix.bat).
Possibly a more complex setup, but it worked ok when you get a hang of it.
jlbarrera wrote:
>
> I am learning the documentation page of importing ServiceMix into the
> Eclipse, and i make this.
>
> The documentation propose run an example "filepoller" based on
> servicemix.xml example file.
> But how i can run ServiceMix in eclipse in a standalone mode, deploying
> SA's, installing components, .. it's possible?
>
> What is the better way of preparing the developed environment for
working
> with ServiceMix?
>
> Thanks!
>
>
--
View this message in context:
http://www.nabble.com/ServiceMix-and-Eclipse-tf3228629s12049.html#a9018460
Sent from the ServiceMix - User mailing list archive at Nabble.com.