public static void main(String[] args) throws Exception { Swarm swarm = new Swarm(); swarm.fraction( MessagingFraction.createDefaultFraction() .defaultServer( (s) -> { s.enableClustering(); s.jmsTopic("my-topic"); s.jmsQueue("my-queue"); })); // Start the container swarm.start(); JAXRSArchive appDeployment = ShrinkWrap.create(JAXRSArchive.class); appDeployment.addResource(MyResource.class); // Deploy your app swarm.deploy(appDeployment); JARArchive deployment = ShrinkWrap.create(JARArchive.class); deployment.addClass(MyService.class); deployment.as(ServiceActivatorArchive.class).addServiceActivator(MyServiceActivator.class); // Deploy the services swarm.deploy(deployment); }
public static void main(String[] args) throws Exception { Swarm container = new Swarm(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.addPackage(Main.class.getPackage()); deployment.addAllDependencies(); // deployment.as( RibbonArchive.class ); container.start().deploy(deployment); }
public static void main(String[] args) throws Exception { Swarm swarm = new Swarm(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "events.war"); deployment.addPackage(Main.class.getPackage()); deployment.addAllDependencies(); deployment.as(RibbonArchive.class).advertise(); swarm.start().deploy(deployment); }
public static void main(String... args) throws Exception { Swarm container = new Swarm(); container.fraction(new ManagementConsoleFraction()); container.start(); }