Posts

Showing posts from 2019

Introducing Apache Karaf Cave 4.2.x

Apache Karaf Cave 4.2.1 has been released this month. It’s a complete refactoring of Karaf Cave, providing cleaner, faster and new features, focusing on repositories. Let’s take a quick tour of the new Karaf Cave ! Cave Repositories, Cave Deployer, Cave Features Gateway Karaf Cave 4.2.x provides three main modules: Repository is a artifact repositories manager service. Deployer is a Karaf instances management service. Features Gateway is a Karaf Features service exposing several features repositories in an unique gateway. Each module is completely atomic and independent from another: you can use Cave Repositories without the Cave Deployer for instance (or the opposite). Cave Repositories Before 4.2.x, Karaf Cave was mainly a OBR repositories manager. Other features were built around OBR. Cave 4.2.x takes a complete different approach. Cave Repositories is now a generic artifacts repositories manager. The purpose is to deal with artifacts storage (pluggable) exposing diffe...

Using Apache Karaf with Kubernetes

Image
In a previous blog post ( http://blog.nanthrax.net/?p=893 ), I introduced the “new” docker support in Karaf and the use of Karaf static distribution. This post follows the previous one by illustrating how to use Karaf docker image with a Kubernetes cluster. Preparing Karaf static docker image As in the previous blog post, we are preparing a Karaf static distribution based docker image. For this blog post, I’m using the example provided in Karaf: https://github.com/apache/karaf/tree/master/examples/karaf-docker-example/karaf-docker-example-static-dist . I’m just building the distribution as usual: karaf-docker-example-static-dist$ mvn clean install Preparing kubernetes testing cluster For this blog, I’m using a minikube installed locally. The installation is pretty simple: Download minikube from https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 Rename minikube-linux-amd64 as minikube Copy minikube in your path, for instance /us...

ActiveMQ HTTP transport connector load balanced with HAProxy

If you are using ActiveMQ, you probably use the default tcp transport connector configured in the conf/activemq.xml : <transportConnectors> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> </transportConnectors> ActiveMQ also provides other transport connectors for some particular protocols ( amqp , mqtt , stomp ) or particular transports. Especially, it supports a very convenient transport connector to go through firewalls: the http transport connector (and extended from http like https , etc. It means that it’s possible to load balance the HTTP connections. We won’t be able to balance the messages (we need a network of brokers for that, see previous blog posts about that. However, the HTTP transport is based on the openwire protocol. So, it’s not just a HTTP request to send a message: the client has to send several HTTP re...

Apache Karaf dynamic and static approach, docker and kubernetes

Image
Most of the Karaf users know the Apache Karaf “standard” distribution. Apache Karaf dynamic approach (“standard” distribution) You can download Apache Karaf “standard” or “minimal” distributions, you download a “dynamic” distribution. By “dynamic”, it means that you start the Karaf runtime and, later, you deploy applications in it. The resolution is performed at runtime, at deployment time. It’s a “application container” approach (like Apache Tomcat, …). You can create your own custom Karaf runtime (using boot features for instance), where the container starts a set of applications at bootstrap. However, it’s not the only approach ! Apache Karaf is a complete polymorphic application runtime, meaning that it can take different form to match your expectations, use cases and devops requirements. Apache Karaf static approach (likely immutable) You can use a “static” approach wit...

Improvements on the Apache Karaf scheduler

Apache Karaf has a scheduler, allowing you to periodically execute actions. It’s powered by Quartz and provide several convenient features. You can easily install the scheduler with the scheduler feature: karaf@root> feature:install scheduler Once you have installed the scheduler, you have new commands available: scheduler:schedule , scheduler:list , etc. The Karaf scheduler also provides a whiteboard pattern to looking for Runnable or Job . It uses the service properties as configuration of the scheduling. It’s what Karaf Decanter uses for the polled collector, like the JMX collector for instance: the Karaf scheduler execute the run() method of the JMX collector every minute by default. You can “reschedule” a job using the scheduler:reschedule command. Scheduler improvements in coming Apache Karaf 4.2.3 release New commands Now, in addition of script, you can also schedule command execution. The previous scheduler:schedule command has been renamed to sch...