7.9. Test the Configuration of the Remote Client

Prerequisites

  • The server must have been started and the Hello World quick start must have been deployed

Procedure 7.5. Task

  • Run this test code:
        
    package org.jboss.esb.client;
    import
    import
    import
    import
    org.jboss.soa.esb.client.ServiceInvoker;
    org.jboss.soa.esb.listeners.message.MessageDeliverException;
    org.jboss.soa.esb.message.Message;
    org.jboss.soa.esb.message.format.MessageFactory;
    public class EsbClient
    {
    public static void main(String[] args)
    {
    System.setProperty("javax.xml.registry.ConnectionFactoryClass",
    "org.apache.ws.scout.registry.ConnectionFactoryImpl");
    try
    {
    Message message = MessageFactory.getInstance().getMessage();
    message.getBody().add("Sample payload");
    ServiceInvoker invoker = new ServiceInvoker("FirstServiceESB",
    "SimpleListener");
    invoker.deliverAsync(message);
    }
    catch (final MessageDeliverException e)
    {
    e.printStackTrace();
    }
    }
    }
    
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.