---
layout: post
title:  "Bring your own JSF implementation to Open Liberty 17.0.0.4"
date:   2017-12-21 12:05:00 +0100
categories: blog
author_picture: https://avatars3.githubusercontent.com/u/3322532
author_github: https://github.com/lauracowen
---
:description: Download updates for JSF Container (bring your own JSF implementation!), Concurrency, and distributed tracing in Open Liberty 17.0.0.4.
= Bring your own JSF implementation to Open Liberty 17.0.0.4
Laura Cowen <https://github.com/lauracowen>
:imagesdir: /
:url-prefix:
:url-about: /

And, like a flash, a second release of Open Liberty (17.0.0.4) is upon us! Fancy bringing your own JSF implementation (Mojarra or MyFaces) to Open Liberty? You can now (and benefit from CDI) with the JSF Container 2.2 feature. Also, administrators can now configure concurrency policies for managed executors (Concurrency updates), and get distributed tracing with our implementation of opentracing.io.

Remember, if you're really keen, you can see what's being developed in Open Liberty in the https://openliberty.io/downloads/[nightly builds]. Feel free to https://openliberty.io/contribute/[raise or even fix a bug]. Fancy influencing the future direction of Open Liberty? Join the https://groups.io/g/openliberty[Open Liberty discussion group].

As we don't have a full set of documentation implemented for Open Liberty yet, the items below point (where relevant) to the official documentation for WebSphere Liberty (which is built on Open Liberty) so you can find out more about them.

You can now download Open Liberty and Open Liberty Tools 17.0.0.4.

[link=https://openliberty.io/downloads/]
image::img/blog/blog_btn_download-ol.svg[Download Open Liberty]

[link=https://stackoverflow.com/tags/open-liberty]
image::img/blog/blog_btn_stack.svg[Ask a question on Stack Overflow]

Alternatively, if you're using Maven, here are the coordinates:

[source,xml]
----
<dependency>
    <groupId>io.openliberty</groupId>
    <artifactId>openliberty-runtime</artifactId>
    <version>17.0.0.4</version>
    <type>zip</type>
</dependency>
----

Or if you're using Docker:

[source]
----
docker pull openliberty/open-liberty
----

In Open Liberty 17.0.0.4, you'll find :

* <<jsfcontainer22,JSF Container 2.2>>
* <<concurrency,Concurrency>>
* <<opentracing,Distributed tracing>>

[#jsfcontainer22]
## JSF Container 2.2

This feature makes it possible to bring your own JSF implementation (either Mojarra or MyFaces) for JSF 2.2 and take advantage of CDI integrations provided by the `cdi-1.2` feature.

To try this, enable the `jsfContainer-2.2` feature in your `server.xml`, and package your own JSF API and implementation inside of your application and off you go!

[source,xml]
----
<featureManager>
    <feature>jsfContainer-2.2</feature>
</featureManager>
----


[#concurrency]
## Concurrency

The administrator is now able to configure concurrency policies for managed executors for finer-grained control over concurrency constraints and other behavior.  This includes how many tasks are allowed to run in parallel, how many tasks can queue up, and what action to take when it is not possible to queue a task for execution, among other behaviors.  Different policies can be assigned for long-running tasks (identified by the `LONGRUNNING_HINT` execution property) versus normal tasks.  Managed executors continue to be backed by the Liberty global thread pool and continue to benefit from Liberty's autonomic tuning, but it is now possible to impose these constraints to individual managed executors or groups of managed executors (multiple can share a single concurrency policy).

To try it out, configure one or more concurrency policies in the `server.xml` file. For example:

[source,xml]
----
<concurrencyPolicy id="max10" max="10" maxQueueSize="30" maxWaitForEnqueue="20s" startTimeout="1m"/>
----

Managed executors can be configured to use the concurrency policy as follows:

[source,xml]
----
<managedExecutorService jndiName="concurrent/executor1" concurrencyPolicyRef="max10"/>
<managedScheduledExecutorService jndiName="concurrent/executor2" concurrencyPolicyRef="max10"/>
----

For more info, see the WebSphere Liberty Knowledge Center docs on https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.liberty.autogen.base.doc/ae/rwlp_config_managedExecutorService.html[Configuring the managed executor service] and https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.liberty.autogen.base.doc/ae/rwlp_config_managedScheduledExecutorService.html[Configuring the managed scheduled executor service].

[#opentracing]
## Distributed tracing

The `opentracing-1.0` feature, together with a user provided `io.opentracing.Tracer` implementation, enables JAX-RS applications to automatically create, propagate, and deliver distributed tracing information.

In an environment with numerous services communicating with each other, distributed trace information provides a way to view the end-to-end flow of requests through multiple services. In many environments, there is a central trace collection service that accepts distributed tracing information from individual applications (one popular distributed tracing service is Zipkin). The central service correlates the distributed tracing information, and presents the end-to-end request flow information with a UI.

The http://opentracing.io/[opentracing.io] project defines an API that applications can use to create, propagate, and deliver distributed trace information. An implementation of the opentracing.io API must be available to an application so that the application can deliver distributed trace information. The implementation of the opentracing.io API must match the implementation of the central trace collection service. For example, if the central trace collection service is Zipkin, then the opentracing.io implementation used by applications must perform distributed tracing functions in a way that is specific to Zipkin.

Typically, the developer of each application in the environment must explicitly add code to the application in order for it to create, propagate, and deliver distributed tracing information. With the `opentracing-1.0` feature of Liberty, developers do not need to add any code to their JAX-RS applications to participate in distributed tracing. The JAX-RS application will automatically create, propagate, and deliver distributed tracing information.

Each Liberty server in the environment must be configured with a user feature that provides an implementation of the opentracing.io API. The user feature must provide an implementation of the opentracing.io API that matches the central trace collection service that is used in the environment.

You can find sample source code for https://github.com/WASdev/sample.opentracing.zipkintracer[a user feature that provides a Zipkin-specific opentracing.io API implementation] on GitHub. Or you can download http://central.maven.org/maven2/net/wasdev/wlp/tracer/liberty-opentracing-zipkintracer/1.0/liberty-opentracing-zipkintracer-1.0-sample.zip[a built version of the user feature] from Maven Central.




## Ready to give it a try?


[link=https://openliberty.io/downloads/]
image::img/blog/blog_btn_download-ol.svg[Download Open Liberty]

[link=https://stackoverflow.com/tags/open-liberty]
image::img/blog/blog_btn_stack.svg[Ask a question on Stack Overflow]
