Previous Topic

Next Topic

Book Contents

Book Index

HTTP Service

Bosch IoT Gateway Software Runtime v.9.2.0 and higher comes with implementation of the OSGi HttpService from Eclipse Equinox based on Jetty Servlet Engine and Http Server. It is the default HttpService implementation since SDK v.10. A migration guide is provided accordingly. The enabling of HTTP/2 support for Bosch IoT Gateway Software is explained in the Developer Guide.

Usage

The Eclipse Equinox implementation of the HttpService is used by default.

The previous Bosch proprietary implementation of the HttpService is deprecated. It is used when the runtime is started with clean storage and with the "server httpcompat" command.

Registering Bundle

The HttpService is registered by the Equinox Http Servlet Bundleorg.eclipse.equinox.http.servlet. In general this bundle provides the HttpServiceServlet used by http.servletbridge that when initialized registers an OSGi Http Service.

Features

The HttpService implementation has support for Java Servlet Specification Version 3.1 and OSGi Compendium R6 Http Whiteboard Specification. A demo is provided – com.prosyst.mbs.osgi.http.whiteboard.servlet.3.0-demo.jar to show how to register servlets, resources and Servlet 3.0 asynchronous request processing using the OSGi HTTP Whiteboard Service with an alias "/servlet3WB" and a folder, having resources at "/servlet3WB-resources".

The following table provides a comparison of the features supported by Bosch and Equinox HttpService Implementations:

Feature

Eclipse Equinox
HttpService
Implementation

(default)

Bosch
HttpService
Implementation

(deprecated)

Servlet Specification Version

3.1

2.5

Apache Felix Http Whiteboard Specification

-

+

OSGi Compendium R6 Http Whiteboard Specification

+

-

WebSocket Remote Events

+

+

Long Poll Remote Events

+

+

HTTP/2

+

-

Configuration

The Managed Service Factory configuration with PID mbs.http.config can be used to create new HttpService instances and to configure existing ones. The factory configuration properties can be found in the HttpService Configuration.

Configuration Registering Bundle

The Managed Service Factory with configuration PID mbs.http.config is registered by OSGi HTTP Jetty Bundlecom.prosyst.mbs.osgi.http.jetty.

SSL Customization

SSL connection parameters can be further customized by registering java.net.ssl.SSLContext and/or javax.net.ssl.SSLParameters service. If such services are available in the registry, they will be used to setup the HTTP server's javax.net.ssl.SSLEngine.

The osgi.http.whiteboard.target service registration property can be used to select the HttpServiceRuntime for which the SSL parameters apply (e.g. by name). If this property is omitted, the parameters will apply to all HTTP service runtimes.