forked from infinite-Joy/websphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_listener_port.py
45 lines (35 loc) · 1.29 KB
/
create_listener_port.py
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
import sys
import java
global AdminConfig
# Common Variables
cellName = ""
nodeName = ""
serverName =- ""
listenerName1 = ""
listenerName2 = ""
queueName = "jms/samplequeue"
connFactory1 = "jms/connFactory1"
connFactory2 = "jms/connFactory2"
def createMessageListener(nodeName, serverName, name, destination, connFactory,
initState, mdbMaxSession, mdbMaxRet):
serv = AdminConfig.getid("/Cell:" + cellName + "/Node:" + nodeName +
"/Server:" + serverName + "/")
mls = AdminConfig.list("MessageListenerService", serv)
print mls
new_listener_port = AdminConfig.create("ListenerPort", mls, [["name", name],
["destinationJNDIName", destination],
["connectionFactoryJNDIName", connFactory],
["maxSessions", mdbMaxSession], ["maxRetries", mdbMaxRet],
["maxMessages", "1"]])
print new_listener_port
print AdminConfig.create("StateManageable", new,
[["initialState", initState]])
print name + " Listener Port Created"
AdminConfig.save()
def main():
print "Creating message listener"
createMessageListener(nodeName, serverName, listenerName1, queueName,
connFactory, "START", "10", "2")
print "done"
if __name__ == "__main__" or __name__ == "main":
main()