首页 分享 WildFly Swarm Initial Release

WildFly Swarm Initial Release

来源:花匠小妙招 时间:2025-08-06 23:19

By Bob McWhirter | May 5, 2015

Happy Cinco De Mayo!

Crack open a cold adult beverage and start retooling your JavaEE skills towards microservices.

What is WildFly Swarm?

WildFly Swarm [1] is a new sidecar project supporting WildFly 9.x to enable deconstructing the WildFly AS and pasting just enough of it back together with your application to create a self-contained executable jar.

JAX-RS is a microservice?

In the simplest case, you make small adjustments to your existing Maven pom.xml that generates a WAR file and you’ll get another artifact with a name akin to myproject-1.0-swarm.jar.

Simply add the wildfly-swarm-plugin to your pom.xml:

<plugin> <groupId>org.wildfly.swarm</groupId> <artifactId>wildfly-swarm-plugin</artifactId> <version>${version.wildfly-swarm}</version> <executions> <execution> <phase>package</phase> <goals> <goal>create</goal> </goals> </execution> </executions> </plugin>

Add a <dependency> block or two:

<dependency> <groupId>org.wildfly.swarm</groupId> <artifactId>wildfly-swarm-jaxrs</artifactId> <version>${version.wildfly-swarm}</version> <scope>provided</scope> </dependency>

Build your project:

mvn package

And run that sucker:

java -jar ./target/myproject-1.0-swarm.jar

Can I get fancier?

You betcha!

Since WildFly Swarm is based upon WildFly 9.x, you have most of the power of WildFly available to you. This includes subsystems such as:

Undertow (Servlets)

JAX-RS

Naming/JNDI

Transactions

Messaging

Datasources

Logging

Weld (CDI)

JBoss MSC

Security

Additionally, if you want to provide your own main(…​) method to instantiate the Container, configure some of the subsystems, and perform whatever deployments you need, that’s possible also!

public class Main { public static void main(String[] args) throws Exception { Container container = new Container(); container.subsystem(new MessagingFraction() .server( new MessagingServer() .enableInVmConnector() .topic("my-topic") .queue("my-queue") ) ); // Start the container container.start(); JaxRsDeployment appDeployment = new JaxRsDeployment(); appDeployment.addResource(MyResource.class); // Deploy your JAX-RS app container.deploy(appDeployment); // Create an MSC deployment ServiceDeployment deployment = new ServiceDeployment(); deployment.addService(new MyService("/jms/topic/my-topic" ) ); // Deploy the services container.deploy( deployment ); } }

Can I use it in production?

We wouldn’t recommend it. We just released 1.0.0.Alpha1. It’s pretty new and we’re sure there’s some dark corners that we have not addressed.

If you come across any issues or desire any improvements, file an issue over at GitHub, and we’ll do our best to make you happy.

What do I download?

There is no special download or installation instructions. Simply start using org.wildfly.swarm artifacts in your pom.xml, throw in the plugin and continue doing your builds. Everything is available through Maven Central.

1. never to be called just "Swarm", because Legal

相关知识

南构王小花手写 常规 Version 1.00 July 8, 2017, initial release
墨儿相惜花字体 Version 1.00 October 15, 2020, initial release图片样张
中国手写
符号字体/提取转换字体/区块组件字体/501
雕花字体
荷花字体
舒芙蕾
中文花体
英文花体
日文花体

网址: WildFly Swarm Initial Release https://www.huajiangbk.com/newsview2247954.html

所属分类:花卉
上一篇: Handbook
下一篇: Unified Types

推荐分享