번들 OSGI를 업데이트하는 동안 서비스/구성 요소를 계속 실행하는 방법 (How to keep service/componnet running while update bundle OSGI)


문제 설명

번들 OSGI를 업데이트하는 동안 서비스/구성 요소를 계속 실행하는 방법 (How to keep service/componnet running while update bundle OSGI)

내 번들에 2개의 서비스 A,B를 구현했습니다. 새 jar 파일을 빌드하고 업데이트 명령을 수행하여 서비스 A의 코드를 변경하고 서비스 B를 다시 시작하지 않고 계속 실행하고 싶습니다.


참조 솔루션

방법 1:

Sounds like you have 2 services in 1 bundle. The unit of deployment is a bundle, so my recommendation is to split the two services into two bundles. Otherwise, undeploying your existing bundle will naturally also tear down Service B.

Alternatively, in case the API/interface resides in a separate bundle, you could deploy a new service‑implementation for A in a separate bundle, with a higher priority, and rewire all uses of the service. Which typically is rather confusing, so it's a distant second place recommendation.

Edit: You comment that you are combining services in a bundle to minimize the number of jars, but you want to update the services independently. Specifically for minimizing the number of jars: Are you trying to solve a problem that you indeed had? I'm mainly working with Liferay, which is fully OSGi, and a plain vanilla installation comes with more than 1000 bundles ‑ the runtime handles it just fine. Make sure you're not preemptively optimizing something that doesn't need optimization.

If your components have different maintenance intervals, then deploy them in different bundles. Period. No use working against the system, which has no problem with the number of bundles at all.

(by DM CHAUOlaf Kock)

참조 문서

  1. How to keep service/componnet running while update bundle OSGI (CC BY‑SA 2.5/3.0/4.0)

#apache-felix #declarative-services #osgi #bundle






관련 질문

Apache Felix 웹 콘솔 브랜딩 (Branding Apache Felix web console)

포함된 Apache Felix를 시작할 수 없습니다. (Cannot start embeded Apache Felix)

Glassfish OSGI 웹 콘솔 자격 증명 (Glassfish OSGI Webconsole Credentials)

Android에 OSGi Felix 포함 (Embed OSGi Felix in Android)

Amdatu OSGI 이벤트 처리기 다른 수신기가 수신 대기 중일 때 수신 대기 시간 지연 (Amdatu OSGI Event Handler time delay to listen when other listener are listening)

OSGi 번들이 Felix 호스트 응용 프로그램으로 시작되지 않음 (OSGi Bundle not starting with Felix Host application)

임베디드 osgi 프레임워크, 서비스 기능을 호출하는 방법은 무엇입니까? (Embedded osgi framework, how to call service functions?)

kaldi 설치 시 libmkl_tbb_thread.so sth 관련 문제 (A problem related to libmkl_tbb_thread.so sth when installing kaldi)

OSGI(Apache Felix)에서 다른 사람의 번들에 대해 AOP를 구현하는 방법은 무엇입니까? (How to implement AOP for someone else's bundles in OSGI (Apache Felix)?)

OSGi r4.1의 ServiceTracker (ServiceTracker in OSGi r4.1)

번들 OSGI를 업데이트하는 동안 서비스/구성 요소를 계속 실행하는 방법 (How to keep service/componnet running while update bundle OSGI)

Equinox에서 Arquillian 실행 (Running Arquillian in Equinox)







코멘트