Pergunta

Apache Karaf é um subjecon de Apache Felix. É definido como "um contêiner OSGI leve".

Não entendo quando devo usar o peso pesado e quando usar o peso leve. O site deles não explica muito isso.

Foi útil?

Solução

O rótulo 'Lightweight OSGI Container' é contrastante KARAF com mais ricos em contêineres OSGI, não com Felix.

Para citar o Nodet Guillaume (autor de Karaf) daqui:

Felix é apenas o tempo de execução do OSGI Core. A KARAF fornece uma "distribuição" baseada no Felix, adicionando outros recursos, como um console, um mecanismo de remoção SSH, um implantador de arquivos e muito mais.

Neste diagrama da arquitetura Karaf, Felix (ou outra implementação do OSGI - atualmente Equinócio também é suportado) é a caixa OSGI, as outras caixas são os recursos adicionados pela KARAF:

Karaf ArchitecturePortanto, a menos que você tenha necessidades específicas que não são atendidas pelo KARAF (exigindo acesso à implementação subjacente), geralmente faz sentido usar isso, pois fornece mais 'fora da caixa'.

Outras dicas

@Marcel Karaf isn't monolithic or huge like a Java EE server. It is a very slim and minimalist implementation. It is a core product without much functionality other than a basic console, file loading so that you can actually read configuration files, etc. The latest zip file of it is 19.1 MB. Yeah. Small. It can easily run on small devices and work in embedded.

What you may be thinking of is something more like ServiceMix which uses Karaf as a core/kernel. But it includes CXF, ActiveMQ, Camel and other libraries in its full configuration. Even then they have minimal, medium and full sizes.

Really, for 99% of the projects out there it wouldn't make sense to start directly with Felix and not use Karaf instead.

Currently, there are three popular open source OSGi containers:

  - Equinox. It is the modular Java runtime at the heart of the Eclipse IDE,
  - Knopflerfish, Is an open source implementation of the OSGi R3 and OSGi R4 specifications. 
  - Apache Felix. Is the open source OSGi container from the Apache Software Foundation.

http://www.javaworld.com/article/2077837/java-se/java-se-hello-osgi-part-1-bundles-for-beginners.html

The Apache project maintains a general-purpose OSGi container called Felix. Here is used as ServiceMix and

The main difference between the ServiceMix and Karaf is that ServiceMix bundles a bunch of other integration components — ActiveMQ message broker, the Camel routing engine, and some other things

According: http://kevinboone.net/osgitest.html

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top