304.5.2. 일괄 메시지 지원


SjmsProducer는 목록을 캡슐화하는 Exchange를 만들어 메시지 컬렉션을 게시할 수 있습니다.The SjmsProducer supports publishing a collection of messages by creating an Exchange that encapsulates a List. 이 SjmsProducer는 목록 내용을 반복하고 각 메시지를 개별적으로 게시합니다.

메시지 배치를 생성할 때 각 메시지에 고유한 헤더를 설정해야 하는 경우 SJMS BatchMessage 클래스를 사용할 수 있습니다. SjmsProducer가 BatchMessage 목록에 표시되면 각 BatchMessage 를 반복하고 포함된 페이로드 및 헤더를 게시합니다.

다음은 BatchMessage 클래스를 사용하는 예입니다. 먼저 BatchMessage 목록을 만듭니다.

List<BatchMessage<String>> messages = new ArrayList<BatchMessage<String>>();
for (int i = 1; i <= messageCount; i++) {
    String body = "Hello World " + i;
    BatchMessage<String> message = new BatchMessage<String>(body, null);
    messages.add(message);
}
Copy to Clipboard Toggle word wrap

그런 다음 목록을 게시합니다.

template.sendBody("sjms:queue:batch.queue", messages);
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat