-
Notifications
You must be signed in to change notification settings - Fork 594
/
18-stomp.html
233 lines (221 loc) · 10.2 KB
/
18-stomp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<script type="text/html" data-template-name="stomp in">
<div class="form-row">
<label for="node-input-name" style="width: 110px;"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-server" style="width: 110px;"><i class="fa fa-bookmark"></i> Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-topic" style="width: 110px;"><i class="fa fa-envelope"></i> Destination</label>
<input type="text" id="node-input-topic" placeholder="topic or queue">
</div>
<div class="form-row">
<label for="node-input-ack" style="width: 110px;"><i class="fa fa-check"></i> Message acknowledgment</label>
<select type="text" id="node-input-ack" style="display: inline-block; width: 250px; vertical-align: top;">
<option value="auto">Auto</option>
<option value="client">Client</option>
<option value="client-individual">Client individual (only v1.1)</option>
</select>
</div>
<div class="form-tips" style="margin-bottom: 12px;">
Enabling the ACK (acknowledgment) will set the <code>ack</code> header to <code>client</code> while subscribing to topics.
This means the items on the broker queue will not be dequeue'd unless an ACK message is sent using the <code>ack</code> node.
</div>
</script>
<script type="text/html" data-help-name="stomp in">
<p>Connects to a server using the Stomp protocol to receive messages.</p>
<p>If the message received is JSON <code>msg.payload</code> will be parsed into an
object. If not it will be the raw data.</p>
<p><code>msg.headers</code> contains any header information that was also delivered.</p>
<p><code>msg.topic</code> is set to the predefined subscription topic.</p>
<p><b>Note</b>: While not a requirement of the Stomp protocol, if connecting to an ActiveMQ server, the destination should
begin with <i>"/queue/"</i> or with <i>"/topic/"</i>. See
<a href="https://stomp.github.io/stomp-specification-1.0.html#frame-SEND" target="new">Stomp 1.0 spec</a>
for more details.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('stomp in',{
category: 'input',
color:"#e8cfe8",
defaults: {
name: {value:""},
server: {type:"stomp-server",required:true},
ack: {value: "auto", required: true},
topic: {value:"",required:true}
},
inputs:0,
outputs:1,
icon: "bridge.png",
label: function() {
return this.name||"stomp";
},
labelStyle: function() {
return (this.name)?"node_label_italic":"";
}
});
</script>
<script type="text/html" data-template-name="stomp out">
<div class="form-row">
<label for="node-input-name" style="width: 110px;"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-server" style="width: 110px;"><i class="fa fa-bookmark"></i> Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-topic" style="width: 110px;"><i class="fa fa-envelope"></i> Destination</label>
<input type="text" id="node-input-topic" placeholder="topic or queue">
</div>
<div class="form-tips" style="margin-bottom: 12px;">The <b>Destination</b> field is optional. If not set uses the <code>msg.topic</code>
property of the message.</div>
</script>
<script type="text/html" data-help-name="stomp out">
<p>Connects to an Stomp capable server to send messages.</p>
<p>The <b>Destination</b> field is optional. If set it overrides the <code>msg.topic</code>
property of the message.</p>
<p><code>msg.headers</code></code>, if set, should be an object containing field/value
pairs to be added as request headers.</p>
<p><b>Note</b>: While not a requirement of the Stomp protocol, if connecting
to an ActiveMQ server, the destination should
begin with <i>"/queue/"</i> or with <i>"/topic/"</i>. See the
<a href="https://stomp.github.io/stomp-specification-1.0.html#frame-SEND" target="new">Stomp 1.0 spec</a>
for more details.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('stomp out',{
category: 'output',
color:"#e8cfe8",
defaults: {
name: {value:""},
server: {type:"stomp-server",required:true},
topic: {value:""}
},
inputs:1,
outputs:0,
icon: "bridge.png",
align: "right",
label: function() {
return this.name||"stomp";
},
labelStyle: function() {
return (this.name)?"node_label_italic":"";
}
});
</script>
<script type="text/html" data-template-name="stomp-server">
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Name">
</div>
<div class="form-row node-input-server">
<label for="node-config-input-server"><i class="fa fa-bookmark"></i> Server</label>
<input class="input-append-left" type="text" id="node-config-input-server" placeholder="localhost" style="width: 45%;" >
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
<input type="text" id="node-config-input-port" placeholder="Port" style="width:45px">
</div>
<div class="form-row">
<label for="node-config-input-user"><i class="fa fa-user"></i> Username</label>
<input type="text" id="node-config-input-user">
</div>
<div class="form-row">
<label for="node-config-input-pass"><i class="fa fa-lock"></i> Password</label>
<input type="password" id="node-config-input-password">
</div>
<div class="form-row">
<label for="node-config-input-protocolversion"><i class="fa fa-tag"></i> Protocol Version</label>
<select type="text" id="node-config-input-protocolversion" style="display: inline-block; width: 250px; vertical-align: top;">
<option value="1.0">v1.0</option>
<option value="1.1">v1.1</option>
</select>
</div>
<div class="form-row">
<label for="node-config-input-vhost"><i class="fa fa-server"></i> vhost</label>
<input type="text" id="node-config-input-vhost" placeholder="Default is null" />
</div>
<div class="form-row">
<label for="node-config-input-reconnectretries"><i class="fa fa-repeat"></i> Reconnect Retries</label>
<input type="number" id="node-config-input-reconnectretries" />
</div>
<div class="form-row">
<label for="node-config-input-reconnectdelay"><i class="fa fa-clock-o"></i> Reconnect Delay (S)</label>
<input type="number" id="node-config-input-reconnectdelay" />
</div>
<div class="form-tips" style="margin-bottom: 12px;">
Reconnection timings are calculated using exponential backoff. The first reconnection happens immediately, the second reconnection happens at +delay ms, the third at + 2*delay ms, etc.
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('stomp-server',{
category: 'config',
defaults: {
server: {required:true},
port: {value:61613,required:true,validate:RED.validators.number()},
protocolversion: {value:"1.0",required:true},
vhost: {},
reconnectretries: {value:0,required:true,validate:RED.validators.number()},
reconnectdelay: {value:1,required:true,validate:RED.validators.number()},
name: {}
},
credentials: {
user: {type:"text"},
password: {type: "password"}
},
label: function() {
return (this.name?this.name:this.server+":"+this.port);
}
});
</script>
<script type="text/html" data-template-name="stomp ack">
<div class="form-row">
<label for="node-input-name" style="width: 110px;"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-server" style="width: 110px;"><i class="fa fa-bookmark"></i> Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-topic" style="width: 110px;"><i class="fa fa-envelope"></i> Destination</label>
<input type="text" id="node-input-topic" placeholder="topic or queue">
</div>
</script>
<script type="text/html" data-help-name="stomp ack">
<p>
ACK is used to acknowledge consumption of a message from a subscription using client acknowledgment. When a client has issued a SUBSCRIBE frame with the ack header set to client any messages received from that destination will not be considered to have been consumed (by the server) until the message has been acknowledged via an ACK.
</p>
<p>
The node allows for following inputs:
<ul>
<li><code>msg.topic</code>The topic for which the message should be acknowledged, if the <b>Destination</b> field is set the msg.topic will be overwritten by this value</li>
<li><code>msg.messageId</code>: The id of the message to acknowledge</li>
<li><code>msg.transaction</code>: Optional transaction name</li>
</ul>
</p>
<p>
See the <a href="https://stomp.github.io/stomp-specification-1.0.html#frame-ACK" target="new">Stomp 1.0 spec</a> for more details.
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('stomp ack',{
category: 'output',
color:"#e8cfe8",
defaults: {
name: {value:""},
server: {type:"stomp-server",required:true},
topic: {value:""}
},
inputs:1,
outputs:0,
icon: "bridge.png",
align: "right",
label: function() {
return this.name||"stomp";
},
labelStyle: function() {
return (this.name)?"node_label_italic":"";
}
});
</script>