132.3. instance consumer - from("hazelcast-instance:foo")
The instance consumer fires if a new cache instance will join or leave the cluster.
샘플은 다음과 같습니다.
fromF("hazelcast-%sfoo", HazelcastConstants.INSTANCE_PREFIX)
.log("instance...")
.choice()
.when(header(HazelcastConstants.LISTENER_ACTION).isEqualTo(HazelcastConstants.ADDED))
.log("...added")
.to("mock:added")
.otherwise()
.log("...removed")
.to("mock:removed");각 이벤트는 메시지 헤더 내에 다음 정보를 제공합니다.
응답 메시지의 헤더 변수:
| 이름 | 유형 | 설명 |
|---|---|---|
|
|
| 이벤트 발생 시 |
|
|
| map consumer sets는 "instancelistener"입니다. |
|
|
| 이벤트 유형 - 추가 또는 제거됩니다. |
|
|
| 인스턴스의 호스트 이름 |
|
|
| 인스턴스의 포트 번호 |