此内容没有您所选择的语言版本。

Chapter 3. Features


3.1. New and Changed features

This section describes the new functionalities introduced in this release. It also contains information about changes in the existing functionalities.

3.1.1. Changes in EventBus JavaScript client

The following section explains the changes in EventBus JavaScript client.

3.1.1.1. EventBus JavaScript client available only in npm

In releases before Eclipse Vert.x 3.9.5, the event bus JavaScript client was available in various locations, such as Maven Central, NPM, and so on.

From Eclipse Vert.x 3.9.5, the EventBus JavaScript client module is available in a new npm location. The client is not available in other locations. You should update your build systems to use the module from the following new location.

3.1.1.2. Versioning of JavaScript client

In releases before Eclipse Vert.x 3.9.5, every Eclipse Vert.x release included a new release of the JavaScript client.

However, from Eclipse Vert.x 3.9.5 onward, a new version of JavaScript client will be available in npm only if there changes in the client. You do not need to update your client application for every Eclipse Vert.x release, unless there is a version change.

The value accessor methods in Row and Tuple throw exceptions instead of returning null for invalid values.

  • The methods in Row throws the NoSuchElementException when a lookup for a given column does not exist.
  • The methods in Row and Tuple throw the ClassCastException when the returned value cannot be casted or coerced to the expected type.

When several instances of the same verticle use the wildcard port (0), the first instance binds to a random port and all the other instances also bind to the same random port.

In releases prior to Eclipse Vert.x 3.9.2, all the instances of the same verticle that used the wildcard port (0) were bound to different random ports.

The prepared statements that are created using the SqlConnection.Prepare method are no longer cached internally. If you want to cache the prepared statements, you must set up the caching.

The PgConnection.Prepare method creates a named prepared statement. In the previous releases, the method created unnamed prepared statements.

The Red Hat build of Eclipse Vert.x for s390x and ppc64le platforms is supported only in OpenShift environments provisioned on IBM Z and IBM Power Systems infrastructure. Running an Eclipse Vert.x application on a stand-alone installation of RHEL on IBM Z and IBM Power Systems is not supported.

Eclipse OpenJ9 Java images for IBM Z, IBM Power Systems and new images for products supported on IBM Z and IBM Power Systems are available in the Red Hat Ecosystem Catalog.

To deploy the example applications on OpenShift environments provisioned on IBM Z and IBM Power Systems infrastructure, specify the relevant IBM Z or IBM Power Systems image name in the pom.xml file and commands.

Some of the example applications also require other products, such as Red Hat Data Grid to demonstrate the workflows. In this case, you must also change the image names of these products to their relevant IBM Z or IBM Power Systems image names in the YAML file of the example applications.

3.1.8. Fluent Query Method

The new class Query is a fluent API. It enables you to create and configure queries before their execution. All the query collectors are available in the Query interface.

The new class PreparedStatement enables you to create and execute prepared statements. The prepared statements can execute multiple interactions such as cursor or stream operations.

The existing class PreparedQuery extends the new class Query. The class can now be used outside the context of the connection.

For example, use the following sample codes to create queries:

  • Collector Query

    PreparedQuery<RowSet<Row>> query = client.preparedQuery(sql);
    PreparedQuery<SqlResult<List<Row>> collectedQuery = query.collecting(Collectors.toList());
    collectedQuery.execute(tuple, ar -> ...);
    
    // Or fluently
    client.preparedQuery(sql).collecting(Collectors.toList()).execute(tuple, ar -> ...);
    Copy to Clipboard Toggle word wrap
  • Prepared query

    connection.prepare(sql, ar1 -> {
      if (ar1.succeded()) {
        PreparedStatement ps = ar1.result();
        PreparedQuery<RowSet<Row>> pq = ps.query();
        pq.execute(tuple, ar2 -> ...);
    
    // Or fluently
        ps.query().execute(tuple, ar2 -> ...);
      }
    });
    Copy to Clipboard Toggle word wrap

3.2. Deprecated features

The following functionalities have been deprecated in this release.

The MqttClientOptions.getKeepAliveTimeSeconds() and MqttClientOptions.setKeepAliveTimeSeconds() methods have been deprecated. Use the MqttClientOptions.getKeepAliveInterval() and MqttClientOptions.setKeepAliveInterval() methods instead to get and set the keep alive interval in seconds.

The HttpServerRequest.netSocket() method has been deprecated. Use the new method HttpServerRequest.toNetSocket() instead to establish a TCP tunnel with the client.

The following example shows you how the deprecated method HttpServerRequest.netSocket() was used.

NetSocket sock = request.netSocket();
Copy to Clipboard Toggle word wrap

The following example shows you how to use the new method HttpServerRequest.toNetSocket().

request.response().toNetSocket(ar -> {
  if (ar.succeeded()) {
    NetSocket sock = ar.result();
  }
Copy to Clipboard Toggle word wrap

3.2.3. Deprecated the upgrade method in HTTP server request

The HttpServerRequest.upgrade() method has been deprecated. Use the new method HttpServerResponse.toWebSocket() instead to upgrade the connection of the current request to a WebSocket.

The following example shows you how the deprecated method HttpServerRequest.upgrade() was used.

ServerWebSocket ws = request.upgrade();
Copy to Clipboard Toggle word wrap

The following example shows you how to use the new method HttpServerResponse.toWebSocket().

request.response().toWebSocket(ar -> {
  if (ar.succeeded()) {
    ServerWebSocket ws = ar.result();
  }
});
Copy to Clipboard Toggle word wrap

3.2.4. Deprecated the sockjs.BridgeOptions class

The sockjs.BridgeOptions class has been deprecated. Use the new sockjs.SockJSBridgeOptions class instead. The sockjs.SockJSBridgeOptions class contains all the options that are required to configure the event bus bridge.

There is no change in the behavior of the new class, except that the name of the data object class has changed. When new bridges were added, there were a lot of duplicate configurations. The new class contains all the possible common configurations, and removes duplicate configurations.

The verticle methods start(Future<Void>) and stop(Future<Void>) have been deprecated. Use the methods start(Promise<Void>) and stop(Promise<Void>) to work with promise.

3.2.6. Extension mechanism for DNS is disabled by default

The extension mechanism for DNS is disabled by default in Eclipse Vert.x. To enable EDNS use the method AddressResolverOptions.setOptResourceEnabled(). Specify the input parameter optResourceEnabled as true.

3.2.7. New connection handler methods

The following new handler methods are available:

  • The HttpClientRequest.connectionHandler() method is deprecated and will be removed in a future release. Use HttpClient.connectionHandler() method instead to call connection handlers for client requests in your application. For example, use the following code to work with HttpClient.connectionHandler() method:

    client.connectionHandler(conn -> {
    	// Connection related code
    });
    Copy to Clipboard Toggle word wrap
  • Future<T>.setHandler() method is deprecated and will be removed in a future release. Use Future<T>.onComplete(), Future<T>.onSuccess(), and Future<T>.onFailure() methods instead to call handlers on completion, success, and failure results of an action. For example, use the following code to work with Future<T>.onComplete() method:

    Future<String> fut = getSomeFuture();
    fut.onComplete(ar -> ...);
    Copy to Clipboard Toggle word wrap

3.2.8. AdminUtils Class is no longer available

The AdminUtils class is no longer available. Use the new KafkaAdminClient class instead to perform administrative operations on a Kafka cluster.

3.2.9. Updates in HTTP Methods for WebSocket

The updates in the HTTP methods for WebSocket are:

  • The usage of the term WebSocket in method names was inconsistent. The method names had incorrect capitalization, for example, Websocket, instead of WebSocket. The methods that had inconsistent usage of web socket in the following classes have been deprecated and will be removed in a future release. Use the new methods that have correct capitalization instead.

    • The following methods in HttpServerOptions class are deprecated.

      Expand
      Deprecated MethodsNew Methods

      getMaxWebsocketFrameSize()

      getMaxWebSocketFrameSize()

      setMaxWebsocketFrameSize()

      setMaxWebSocketFrameSize()

      getMaxWebsocketMessageSize()

      getMaxWebSocketMessageSize()

      setMaxWebsocketMessageSize()

      setMaxWebSocketMessageSize()

      getPerFrameWebsocketCompressionSupported()

      getPerFrameWebSocketCompressionSupported()

      setPerFrameWebsocketCompressionSupported()

      setPerFrameWebSocketCompressionSupported()

      getPerMessageWebsocketCompressionSupported()

      getPerMessageWebSocketCompressionSupported()

      setPerMessageWebsocketCompressionSupported()

      setPerMessageWebSocketCompressionSupported()

      getWebsocketAllowServerNoContext()

      getWebSocketAllowServerNoContext()

      setWebsocketAllowServerNoContext()

      setWebSocketAllowServerNoContext()

      getWebsocketCompressionLevel()

      getWebSocketCompressionLevel()

      setWebsocketCompressionLevel()

      setWebSocketCompressionLevel()

      getWebsocketPreferredClientNoContext()

      getWebSocketPreferredClientNoContext()

      setWebsocketPreferredClientNoContext()

      setWebSocketPreferredClientNoContext()

      getWebsocketSubProtocols()

      getWebSocketSubProtocols()

      setWebsocketSubProtocols()

      setWebSocketSubProtocols()

      The new methods for WebSocket subprotocols use List<String> data type instead of a comma separated string to store items.

    • The following methods in HttpClientOptions class are deprecated.

      Expand
      Deprecated MethodsNew Methods

      getTryUsePerMessageWebsocketCompression()

      getTryUsePerMessageWebSocketCompression()

      setTryUsePerMessageWebsocketCompression()

      setTryUsePerMessageWebSocketCompression()

      getTryWebsocketDeflateFrameCompression()

      getTryWebSocketDeflateFrameCompression()

      getWebsocketCompressionAllowClientNoContext()

      getWebSocketCompressionAllowClientNoContext()

      setWebsocketCompressionAllowClientNoContext()

      setWebSocketCompressionAllowClientNoContext()

      getWebsocketCompressionLevel()

      getWebSocketCompressionLevel()

      setWebsocketCompressionLevel()

      setWebSocketCompressionLevel()

      getWebsocketCompressionRequestServerNoContext()

      getWebSocketCompressionRequestServerNoContext()

      setWebsocketCompressionRequestServerNoContext()

      setWebSocketCompressionRequestServerNoContext()

    • The following handler methods in HttpServer class are deprecated.

      Expand
      Deprecated MethodsNew Methods

      websocketHandler()

      webSocketHandler()

      websocketStream()

      webSocketStream()

  • WebsocketRejectedException is deprecated. The methods will throw the UpgradeRejectedException instead.

The following authentication and authorization classes and methods are deprecated and will be replaced in a future release.

  • Classes:

    • AbstractUser
    • PubSecKeyOptions
    • JDBCAuthOptions
    • JDBCHashStrategy
    • AccessToken
    • KeycloakHelper
    • ShiroAuth
    • AuthProviderInternal
  • Methods:

    • User.isAuthorized()
    • User.clearCache()
    • User.setAuthProvider()
    • Oauth2Auth.introspectToken()
    • Oauth2Auth.getFlowType()
    • Oauth2Auth.loadJWK()
    • Oauth2Auth.rbacHandler()
    • Oauth2ClientOptions.isUseBasicAuthorization()
    • Oauth2ClientOptions.setUseBasicAuthorizationHeader()
    • Oauth2ClientOptions.getScopeSeparator()
    • Oauth2ClientOptions.setScopeSeparator()

Use the following new methods to create clients that do not have shared data sources with other clients. These methods maintain their own data sources.

Expand
Deprecated MethodsNew Methods

MongoClient.createNonShared()

MongoClient.create()

JDBCClient.createNonShared()

JDBCClient.create()

CassandraClient.createNonShared()

CassandraClient.create()

MailClient.createNonShared()

MailClient.create()

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat