33 < head >
44 < meta charset ="utf-8 ">
55 < meta http-equiv ="x-ua-compatible " content ="ie=edge ">
6- < title > [email protected] , rx-stomp@2.
0.1 </ title > 6+ < title > [email protected] , rx-stomp@2.
1.0 </ title > 77 < meta name ="description " content ="">
88 < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
99
1515 < body >
1616
1717 < div class ="navbar navbar-default navbar-fixed-top visible-xs ">
18- < a href ="
../ "
class ="
navbar-brand "
> [email protected] , rx-stomp@2.
0.1 </ a > 18+ < a href ="
../ "
class ="
navbar-brand "
> [email protected] , rx-stomp@2.
1.0 </ a > 1919 < button type ="button " class ="btn btn-default btn-menu ion-ios-menu " id ="btn-menu "> </ button >
2020 </ div >
2121
@@ -71,7 +71,10 @@ <h3>File</h3>
7171 < h3 > Description</ h3 >
7272 </ p >
7373 < p class ="comment ">
74- < p > RPC Config. For examples see the < a href ="/guide/rx-stomp/ng2-stompjs/remote-procedure-call.html "> guide</ a > .</ p >
74+ < p > This is a Ninja-level topic.</ p >
75+ < p > Configuration and customization hooks for RxStomp RPC reply handling.</ p >
76+ < p > For usage examples, see the guide:
77+ /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html</ p >
7578
7679 </ p >
7780
@@ -140,14 +143,21 @@ <h3 id="inputs">
140143 </ tr >
141144 < tr >
142145 < td class ="col-md-4 ">
143- < div class ="io-line "> Defined in < a href ="" data-line ="23 " class ="link-to-prism "> consolidated/rx-stomp/src/rx-stomp-rpc-config.ts:23 </ a > </ div >
146+ < div class ="io-line "> Defined in < a href ="" data-line ="64 " class ="link-to-prism "> consolidated/rx-stomp/src/rx-stomp-rpc-config.ts:64 </ a > </ div >
144147 </ td >
145148 </ tr >
146149
147150 < tr >
148151 < td class ="col-md-4 ">
149- < div class ="io-description "> < p > Name of the reply queue. See the guide for details.
150- Default < code > /temp-queue/rpc-replies</ code > suitable for RabbitMQ and ActiveMQ.</ p >
152+ < div class ="io-description "> < p > Destination name for the reply queue used by RPC.</ p >
153+ < p > Default: < code > /temp-queue/rpc-replies</ code > — suitable for brokers like RabbitMQ and ActiveMQ that
154+ support temporary or auto-named queues and route replies based on the < code > reply-to</ code > header.</ p >
155+ < p > When to customize:</ p >
156+ < ul >
157+ < li > Your broker requires a different temporary-queue prefix/name.</ li >
158+ < li > You prefer a dedicated, durable, or pre-provisioned reply destination.</ li >
159+ < li > You want to isolate replies per application instance or user.</ li >
160+ </ ul >
151161</ div >
152162 </ td >
153163 </ tr >
@@ -175,13 +185,27 @@ <h3 id="inputs">
175185 </ tr >
176186 < tr >
177187 < td class ="col-md-4 ">
178- < div class ="io-line "> Defined in < a href ="" data-line ="27 " class ="link-to-prism "> consolidated/rx-stomp/src/rx-stomp-rpc-config.ts:27 </ a > </ div >
188+ < div class ="io-line "> Defined in < a href ="" data-line ="83 " class ="link-to-prism "> consolidated/rx-stomp/src/rx-stomp-rpc-config.ts:83 </ a > </ div >
179189 </ td >
180190 </ tr >
181191
182192 < tr >
183193 < td class ="col-md-4 ">
184- < div class ="io-description "> < p > Setup the reply queue. See the guide for details.</ p >
194+ < div class ="io-description "> < p > This is a Ninja-level topic.</ p >
195+ < p > A hook to set up the reply queue and return an Observable of reply messages.</ p >
196+ < p > Defaults to a function that uses RxStomp.unhandledMessage$, which is adequate when the broker
197+ routes replies (via < code > reply-to</ code > ) to a temporary queue that doesn’t have an explicit subscription.</ p >
198+ < p > Provide a custom implementation when:</ p >
199+ < ul >
200+ < li > The broker requires an explicit subscription to the reply destination.</ li >
201+ < li > You want to apply operators (e.g., share, retry) or diagnostics to the reply stream.</ li >
202+ </ ul >
203+ < p > Contract:</ p >
204+ < ul >
205+ < li > Must return an Observable that emits every reply message (< a href ="../interfaces/IMessage.html "> IMessage</ a > ) received on
206+ the reply destination. RxStompRPC will filter messages by < code > correlation-id</ code > .</ li >
207+ < li > The Observable should remain active across reconnects or be resilient to resubscription.</ li >
208+ </ ul >
185209</ div >
186210 </ td >
187211 </ tr >
@@ -205,26 +229,82 @@ <h3 id="inputs">
205229import { RxStomp } from './rx-stomp.js';
206230
207231/**
208- * For examples see the [guide](/guide/rx-stomp/ng2-stompjs/remote-procedure-call.html).
232+ * This is a Ninja-level topic.
233+ *
234+ * A factory function type used to create an Observable for the reply queue.
235+ *
236+ * Purpose
237+ * - RxStompRPC needs an Observable that emits all RPC replies. By default, it uses
238+ * RxStomp.unhandledMessage$, which receives messages that don’t match any explicit subscription.
239+ * - Implement this to route replies from a dedicated queue or custom destination if your broker
240+ * requires it.
241+ *
242+ * Parameters
243+ * - replyQueueName: The queue/destination where RPC replies should arrive.
244+ * - rxStomp: The active RxStomp instance (use it to set up any subscriptions you need).
209245 *
210- * Part of `@stomp/rx-stomp`
246+ * Return
247+ * - An Observable that emits every reply ({@link IMessage}) arriving on the reply queue.
248+ *
249+ * Notes
250+ * - The returned Observable should be “hot” (i.e., continue receiving frames without requiring
251+ * downstream subscribers). If you return a cold Observable, RxStompRPC ensures it remains
252+ * subscribed internally to keep the stream alive.
253+ * - The Observable must include all messages for the reply queue; RxStompRPC will filter replies
254+ * per request using the correlation-id header.
255+ *
256+ * Example: use a dedicated temporary reply queue
257+ * ```typescript
258+ * const setupReplyQueue: setupReplyQueueFnType = (replyQueueName, rxStomp) => {
259+ * // Ensure the broker delivers replies to `replyQueueName` for this session.
260+ * // Then return a hot Observable of all messages from that destination.
261+ * return rxStomp.watch({ destination: replyQueueName });
262+ * };
263+ * ```
211264 */
212265export type setupReplyQueueFnType = (
213266 replyQueueName: string,
214- rxStomp: RxStomp
267+ rxStomp: RxStomp,
215268) => Observable<IMessage>;
216269
217270/**
218- * RPC Config. For examples see the [guide](/guide/rx-stomp/ng2-stompjs/remote-procedure-call.html).
271+ * This is a Ninja-level topic.
272+ *
273+ * Configuration and customization hooks for RxStomp RPC reply handling.
274+ *
275+ * For usage examples, see the guide:
276+ * /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html
219277 */
220278export class RxStompRPCConfig {
221279 /**
222- * Name of the reply queue. See the guide for details.
223- * Default `/temp-queue/rpc-replies` suitable for RabbitMQ and ActiveMQ.
280+ * Destination name for the reply queue used by RPC.
281+ *
282+ * Default: `/temp-queue/rpc-replies` — suitable for brokers like RabbitMQ and ActiveMQ that
283+ * support temporary or auto-named queues and route replies based on the `reply-to` header.
284+ *
285+ * When to customize:
286+ * - Your broker requires a different temporary-queue prefix/name.
287+ * - You prefer a dedicated, durable, or pre-provisioned reply destination.
288+ * - You want to isolate replies per application instance or user.
224289 */
225290 public replyQueueName?: string;
291+
226292 /**
227- * Setup the reply queue. See the guide for details.
293+ * This is a Ninja-level topic.
294+ *
295+ * A hook to set up the reply queue and return an Observable of reply messages.
296+ *
297+ * Defaults to a function that uses RxStomp.unhandledMessage$, which is adequate when the broker
298+ * routes replies (via `reply-to`) to a temporary queue that doesn’t have an explicit subscription.
299+ *
300+ * Provide a custom implementation when:
301+ * - The broker requires an explicit subscription to the reply destination.
302+ * - You want to apply operators (e.g., share, retry) or diagnostics to the reply stream.
303+ *
304+ * Contract:
305+ * - Must return an Observable that emits every reply message ({@link IMessage}) received on
306+ * the reply destination. RxStompRPC will filter messages by `correlation-id`.
307+ * - The Observable should remain active across reconnects or be resilient to resubscription.
228308 */
229309 public setupReplyQueue?: setupReplyQueueFnType;
230310}
0 commit comments