vertx rx java_光魔科技

news/2024/11/25 23:45:31/

Most of the examples are available in all the languages that Vert.x supports.

You’ll find the examples for the relevant language in a directory src/main/${lang} where lang is an identifier for the

language, e.g. java, js, ruby etc.

For example you’ll find the Vert.x core Java examples in core-examples/src/main/java and you’ll find the Vert.x core

JavaScript examples in core-examples/src/main/js

Note

All the non-Java examples are automatically generated from the Java examples using our magic code translator.

Running the examples

Running in your IDE

Most of the Java examples can be run directly in your IDE (if you have one!).

We provide a main() method in most of the example classes which allows you to conveniently run them directly in your IDE.

Just right click the main method or class in your IDE and run as…​ application (supported by all major IDEs).

Running at the command line

If vertx is installed you can also run any verticle directly on the command line. This way of working may be of interest

to you, if you don’t want to use Maven or Gradle or perhaps you don’t use an IDE.

Or perhaps you’re just a command line kind of person.

If you’re coming from using other platforms such as Node.js you might want to work this way. You can think of the

vertx command as a bit like the node command in Node.js.

Instructions for installing Vert.x are in the next section.

Once Vert.x is installed, to run an example, just cd to the example directory and type vertx run followed by the filename

of the verticle. For example

cd core-examples/src/main/java/io/vertx/example/core

vertx run EchoServer.java

cd core-examples/src/main/js/echo

vertx run echo_server.js

Yes! You can run Java source files directly using Vert.x (no compilation required).

Installing Vert.x

Note

This is only necessary if you want to run Vert.x at the command line. If you’d prefer to work with Maven or

Gradle projects then you don’t need to pre-install Vert.x - you just let Maven/Gradle pull in the Vert.x dependencies

into your project as you would with any dependency.

Pre-requisites: You will need to have Java 8 JDK installed.

Unzip it somewhere on your disk (e.g. in your home directory)

Set your PATH environment variable to include the installation directory

Test the install by typing vertx -version.

On the download page, you will find several distributions. Each distribution has a different set

of components:

Min: The min distribution contains only Vert.x Core, the support of the different

languages, and the Hazelcast clustering.

Full: The full distribution contains all the components of the Vert.x stack. It includes

Vert.x web and the different data access technologies.

Vert.x core examples

The Vert.x core examples contains a wide range of examples using just Vert.x Core.

Vert.x-Web examples

Vert.x-Web is a toolkit for building web applications using Vert.x

The Vert.x-Web examples contains a wide range of examples using Vert.x-Web

Vert.x Web Client examples

Vert.x Web Client that provides an easy to use web client for Vert.x.

The Vert.x Web Client examples contains a wide range of examples using the Vert.x Web Client

Vertx Unit examples

Vertx-Unit is a library for writing asynchronous tests. We include some examples of how to use this tool to test

your Vert.x (or other asynchronous) applications.

The Vert.x Unit examples shows how to use Vert.x Unit.

Vert.x JUnit 5 examples

The vertx-junit5 modules allow testing Vert.x asynchronous operations with JUnit 5.

RxJava examples

Vert.x for RxJava provides most of its APIs as RxJava so you can use those if you prefer.

RxJava is a great choice when you want to perform complex operations on multiple asynchronous streams of data.

The Vert.x RxJava 2 / Vert.x RxJava 1 examples contains a wide range of examples using Vert.x for RxJava

gRPC examples

The Vert.x gRPC Examples show how you can implement a gRPC service and invoke a gRPC service with Vert.x.

Kotlin examples

The Vert.x Kotlin Examples shows a few examples with Kotlin such a REST application,

Kotlin coroutines and usage of KotlinTest.

Mail examples

The Vert.x Mail examples

contains a few examples using Vert.x Mail

The mail examples show different ways to create the mail message and send it via

tls, ssl etc. The examples either use localhost:25 to send a mail or use host

mail.example.com. To actually run the examples you will have to change the

mail server and the user credentials in the MailLogin example.

Maven Service Factory examples

The Vert.x Maven service factory examples shows how to package a verticle that

can be deployed using the Maven Service Factory. Such a deployment is also demonstrated using either the command line

or the api.

Service Proxy Examples

The Vert.x Service Proxy examples contains an example of service proxy usage.

It depicts how a service provider can be implemented and how the published service can be consumed.

OSGi Examples

The Vert.x OSGi examples contains a few examples using Vert.x in an OSGi context.

Cloud Foundry examples

The Vert.x Cloud Foundry example shows how to deploy Vert.x application to a Cloud Foundry service or platform of your choice.

Docker examples

The Vert.x Docker examples shows how to deploy Vert.x application in Docker containers.

It also contains an example of the application that can be deployed on Fabric8.

Openshift & Kubernetes examples

The Vert.x OpenShift 3 examples shows how to deploy Vert.x applications on

Openshift 3 and Kubernetes. It also demonstrates clustering and service discovery.

Spring Examples

The Vert.x Spring Examples shows how vert.x application can be integrated inside a Spring

ecosystem.

Redis example

The Vert.x Redis Example shows how you can interact with Redis using the vert.x Redis client.

Mongo example

The Vert.x Mongo Example shows how you can interact with MongoDB using the vert.x Mongo client.

Reactive SQL client example

The Reactive SQL Client Examples shows how you can interact PostgreSQL or MySQL Databases using the Reactive SQL client.

JDBC example

The Vert.x JDBC Examples shows how you can interact JDBC Databases using the vert.x JDBC

client.

Kafka example

The Vert.x Kafka Examples shows how you can interact Kafka using the vert.x Kafka

client.

MQTT example

The Vert.x MQTT Examples shows how you can write MQTT servers and clients using Vert.x MQTT.

Service Proxy Examples

The Vert.x Service Proxy examples contains an example of service proxy usage.

It depicts how a service provider can be implemented and how the published service can be consumed.

AMQP Bridge examples

The Vert.x AMQP Bridge Examples show how you can interact with AMQP 1.0 servers using the Vert.x AMQP Bridge.

Java 9 examples

This Java 9 examples shows how a simple Java 9 modular application using Vert.x as anonymous modules.

Vert.x fatjar examples

The Vert.x fatjar Examples show how you can build fatjar with Maven or Gradle.

HTTP/2 Showcase

This HTTP/2 Showcase application highlights the benefits of HTTP/2 when dealing with latency on the web.

Camel Bridge examples

The Vert.x Camel Bridge Examples show how you can use Apache Camel routes from

the event bus.

JCA example

The Vert.x JCA Examples provide a JEE compliant application that enables to you deploy the application into a

Wildfly application server. While simple in implementation, the JCA examples

provides a good point of departure for your own development.

Micrometer metrics examples

The Vert.x Micrometer metrics examples show how to collect Vert.x metrics

with Micrometer and send them to backends such as Prometheus or InfluxDB.

GraphQL examples

The Vert.x Web GraphQL examples contain simple client/server GraphQL applications built with Vert.x Web GraphQL and the GraphQL-Java library.


http://www.ppmy.cn/news/543026.html

相关文章

乐乐音乐4.0简洁版

乐乐音乐4.0简洁版 开发环境:android studio 支持音频格式 mp3、ape、flac、wav等 支持歌词格式 ksc歌词:卡拉OK歌词 hrc歌词:happy lyrics歌词,乐乐音乐4.0自定义的动感歌词格式,可准确到歌词每个字。 krc歌词&…

Defy刷魔趣2.3.7包~

由于用的defy手机一直都是刚入手的时候装的原生态系统,这么久了,系统垃圾文件太多,用起来非常不爽,今天决定把它做了,据说魔趣的系统做的挺不错,决定换成它了。网上的刷机教程挺多的,但这毕竟是…

Android--音乐播放器

自己做的图片,自定义的SeekBar,做得有点丑,大家将就着看看,最近有些忙,这个播放器 一直没怎么去加功能,大家有兴趣的自己下载看看,有什么建议和意见,非常欢迎提出来, 只写了三分之…

【转】Lomo

Lomo是Let Ourlifebe Magic and Open,让我们的生活开放、有魔力。Lomo拉玛、乐魔、裸猫……乐摸!尽管翻译版本繁多,但是在香港和台湾,Lomo的爱好者们给它起了一个恰当的中文名字——乐摸——让我们快乐地抚摸生活! lo…

认准魔趣吧唯一网址https://www.moqu8.com,谨防上当受骗!

近期,我们发现有不法分子冒充魔趣吧,建立骗子站点,站内全是空壳网页,并无任何实质内容!请大家认准魔趣吧唯一网址https://www.moqu8.com ,绿色安全认证标识! 骗子网站即时采集魔趣吧的文章和图…

Android音乐播放器demo

最近试着做了一个简单的音乐播放器,下面是一些自己的小小总结: 1、我用的是MediaPlayer来播放,掌握它的生命周期很重要 2、在准备播放的时候,即由Initialized变成Prepared的时候,推荐使用异步的prepareAsnc&#x…

音乐播放器android-1.0

音乐播放的基本功能都已实现 1、概述1.1、简介1.2、音乐文件 2、功能2.1、登录2.2、注册2.3、记住用户2.4、播放,暂停,上一首,下一首2.5、自动播放下一首2.6、进度条拖动2.7、本地音乐列表2.8、本地音乐搜索 3、代码3.1、MyHelper3.2、MainAc…

lomo什么意思?

LOMO拉玛、乐魔、裸猫……乐摸!尽管翻译版本繁多,但是在香港和台湾,Lomo的爱好者们给它起了一个恰当的中文名字--乐摸--让我们快乐地抚摸生活!LOMO,四个字母排列组合成一种相机的牌子,不尖端,却…