-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhackathon-watch.html
More file actions
71 lines (64 loc) · 3.11 KB
/
hackathon-watch.html
File metadata and controls
71 lines (64 loc) · 3.11 KB
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
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Solace Systems Web Messaging API for JavaScript
PublishSubscribe tutorial - Topic Subscriber
Demonstrates subscribing to a topic for direct messages and receiving messages
-->
<html lang="en">
<head>
<title>Solace Web Messaging </title>
<meta charset="utf-8"/>
<!-- Load Solace Systems Web Messaging API for JavaScript -->
<script src="lib/solclient-debug.js"></script>
<!-- Load the PublishSubscribe Topic Subscriber tutorial -->
<script src="TopicSubscriber.js"></script>
<!-- Execute the PublishSubscribe Topic Subscriber tutorial -->
<script>
window.onload = function () {
// enable logging to JavaScript console at INFO level
// NOTICE: works only with "lib/solclient-debug.js"
var factoryProps = new solace.SolclientFactoryProperties();
factoryProps.logLevel = solace.LogLevel.INFO;
solace.SolclientFactory.init(factoryProps);
// create the subscriber, specifying name of the subscription topic
var subscriber = new TopicSubscriber('>');
// assign buttons to the subscriber functions
document.getElementById("connect").addEventListener("click", subscriber.connect);
document.getElementById("disconnect").addEventListener("click", subscriber.disconnect);
document.getElementById("subscribe").addEventListener("click", subscriber.subscribe);
document.getElementById("unsubscribe").addEventListener("click", subscriber.unsubscribe);
};
</script>
</head>
<body>
<h1>Solace Hackathon</h1>
<h2>Mesh Network topic subscriber </h2>
Press connect then subscribe to see if your message are being received into the core network
<p>
<label>Solace router web transport URL: </label><input type = "text" id = "host" value = "52.220.223.99:80" />
<button id="connect">Connect</button>
<button id="disconnect">Disconnect</button>
</p>
<p>
<button id="subscribe">Subscribe</button>
<button id="unsubscribe">Unsubscribe</button>
</p>
<textarea id="log" rows="20" cols="90" autofocus></textarea>
</body>
</html>