Posts

Apache Karaf, Cellar, Camel, ActiveMQ monitoring with ELK (ElasticSearch, Logstash, and Kibana)

Image
Apache Karaf, Cellar, Camel, and ActiveMQ provides a lot of information via JMX. More over, another very useful source of information is in the log files. If these two sources are very interesting, for a “real life” monitoring, we need some additional features: The JMX information and log messages should be stored in order to be requested later and history. For instance, using jconsole, you can request all the JMX attributes to get the number, but these numbers have to be store somewhere. It’s quite the same for the log. Most of the time, you define a log file rotation, or you periodically cleanup the logs. So the log messages should be store as well to be requested later. Numbers are good, graphics are even better. Once the JMX “numbers” are stored somewhere, a good feature is to use these numbers to create some charts. And also, we can define some kind of SLA: at some point, if a number is not “acceptable” for instance greater than a “wa...

Coming in Karaf 3.0.0: new enterprise JPA (OpenJPA, Hibernate) and CDI (OpenWebBeans, JBoss Weld) features

Apache Karaf 3.0.0 is now mostly ready (I’m just polishing the documentation). In previous post, I introduced new enterprise features like JNDI, JDBC, JMS. As I said, the purpose is to provide a full flexible enterprise ready container, easy to use and extend for the users. Easy to use means that a simple command will extend your container, with feature that can help you a lot. JPA Previous Karaf version already provided a jpa feature. However, this feature “only” installs the Aries JPA bundles, allowing to expose the EntityManager as an OSGi service. It doesn’t install any JPA engine. It means that, previously, the users had to install all bundles required to have a persistence engine. As very popular persistence engines, Karaf 3.0.0 provides two ready-to-use features: karaf@root()> feature:install openjpa The openjpa feature brings Apache OpenJPA in Apache Karaf. karaf@root()> feature:install hibernate The hibernate feature brings Hibernate in Apache K...

Coming in Karaf 3.0.0: new enterprise JMS feature

In my previous post, I introduced the new enterprise JDBC feature. To follow the same purpose, we introduced the new enterprise JMS feature. JMS feature Like the JDBC feature, the JMS feature is an optional one. It means that you have to install it first: karaf@root()> feature:install jms The jms feature installs the JMS service which is mostly a JMS “client”. It doesn’t install any broker. For the rest of this post, I’m using a ActiveMQ embedded in my Karaf: karaf@root()> feature:repo-add activemq 5.9.0karaf@root()> feature:install activemq-broker Like the JDBC feature, the JMS feature provides: an OSGi service jms:* commands a JMX JMS MBean The OSGi service provides a set of operation to create JMS connection factories, send JMS messages, browse a JMS queue, etc. The commands and MBean manipulate the OSGi service. Commands The jms:create command allows you to create a JMS connection factory. This command automatically creates a connectionfactory-[nam...

Coming in Karaf 3.0.0: new enterprise JDBC feature

Some weeks (months ;)) ago, my colleague Christian (Schneider) did a good job by creating some useful commands to manipulate databases directly in Karaf. We discussed together where to put those commands. We decided to submit a patch at ServiceMix because we didn’t really think about Karaf 3.0.0 at that time. Finally, I decided to refactore those commands as a even more “useful” Karaf feature and prepare it for Karaf 3.0.0. JDBC feature By refactoring, I mean that it’s no more only commands: I did a complete JDBC features, providing a OSGi service, a set of commands and a MBean. The different modules are provided by the jdbc feature. Like most of other enterprise features, the jdbc feature is not installed by default. To enable it, you have to install the jdbc feature first: karaf@root()> feature:install jdbc This feature provides: a JdbcService OSGi service a set of jdbc:* commands a JDBC MBean (org.apache.karaf:type=jdbc,name=*) The OSGi service provide...

Coming in Karaf 3.0.0: new enterprise JNDI feature

In previous Karaf version (2.x), the JNDI support was “basic”. We just leveraged Aries JNDI to support the osgi:service JNDI scheme to reference the OSGi services using JNDI name. However, we didn’t provide a fully functionnal JNDI initial context, nor any tooling around JNDI. In part of the new enterprise features coming with Karaf 3.0.0, the JNDI support is now more “complete”. Add JNDI support As most of the other enterprise features, the JNDI feature is an optional one. It means that you have to install the jndi feature first: karaf@root()> feature:install jndi The jndi feature installs several parts. Ready to use initial context Like in previous version, Karaf provides a fully compliant implementation of the OSGi Alliance JNDI Service Specification. This specification details how to advertise InitialContextFactory and ObjectFactories in an OSGi environment. It also defines how to obtain services from services registry via JNDI. Now, it’s pos...

Coming in Karaf 3.0.0: RBAC support for OSGi services and console commands

In a previous post, we saw a new Karaf feature: support of user groups and Role-Based Access Controle (RBAC) for the JMX layer . We extended the RBAC support to the OSGi services, and by side effect to the console commands (as a console command is also an OSGi service). RBAC for OSGi services The JMX RBAC support uses a MBeanServerBuilder . The KarafMBeanServerBuilder “intercepts” the call to the MBeans, checks the definition (defined in etc/jmx.acl.*.cfg configuration files) and defines if the call can be performed or not. Regarding the RBAC support for OSGi services, we use a similar mechanism. The Karaf Service Guard provides a service listener which intercepts the service calls, and check if the call to the service can be performed or not. The list of “secured” OSGi service is defined in the karaf.secured.services property in the etc/system.properties (using a LDAP syntax filter). By default, we only “intercept” (and so secure) the command OSG...

Some books review: Instant Apache Camel Messaging System,Learning Apache Karaf, and Instant Apache ServiceMix How-To

I’m pleased to be reviewer on new books published by Packt: Instant Apache Camel Messaging System Learning Apache Karaf Instant Apache ServiceMix How-To I received a “hard” copy from Packt (thanks for that), and I’m now able to do the review. Instant Apache Camel Messaging System, by Evgeniy Sharapov. Published by Packt publishing in September 2013 This book is a good introduction to Camel. It covers Camel fundamentals. What is Apache Camel It’s a quick introduction about Camel, in only four pages. We have a good overview about Camel basics: what is a component, routes, contexts, EIPs, etc. We have to see that as it is: it’s just a quick introduction. Don’t expect a lot of details about the Camel basics, it just provides a very high level overview. Installation To be honest, I don’t like this part. It focus mostly on using Maven with Camel: how to use Camel with Maven, integrate Camel in your IDE (Eclipse, or IntelliJ), usage of the archet...