Esempio n. 1
0
    async def run(self):
        eftl = Eftl()
        print(eftl.get_version())

        try:
            self.ec = await eftl.connect(
                "ws://localhost:9191/channel|ws://localhost:9192/channel",
                client_id='python-demo-receiver',
                event_loop=self.loop,
                username='******',
                password='******',
                on_connect=self.onConnect,
                on_disconnect=self.onDisconnect,
                trust_all=False,
                trust_store=Path(
                    "/Users/nsalwantibco.com/ftlnew/build/install/bin/ftl-trust.pem"
                ))
            print("ready to recieve messages")

            await self.ec.subscribe(matcher="""{}""",
                                    on_message=self.on_message)
        except (EOFError, KeyboardInterrupt):
            print("\nKeyboard interrupt issued; now exiting...")
            self.loop.close()
            sys.exit(-1)
Esempio n. 2
0
    async def run(self):
        eftl = Eftl()
        print(eftl.get_version())

        self.ec = await eftl.connect(
            "ws://localhost:9191/map|ws://localhost:9191/map",
            client_id='python-demo-receiver',
            event_loop=self.loop,
            username='******',
            password='******',
            on_disconnect=self.onDisconnect,
            trust_all=False,
            trust_store=Path(
                "/Users/nsalwantibco.com/ftlnew/build/install/bin/ftl-trust.pem"
            ))

        map1 = await self.ec.create_kv_map("map1")
        print("Going to get Map value")
        await map1.get("map_field", on_success=self.print_map)
Esempio n. 3
0
    async def run(self):
        eftl = Eftl()

        print(eftl.get_version())

        self.ec = await eftl.connect(
            self.url,
            client_id='python-demo-sender',
            event_loop=self.loop,
            username='******',
            password=self.password,
            on_disconnect=self.onDisconnect,
            trust_all=False,
            trust_store=Path(
                "/Users/nsalwantibco.com/ftlnew/build/install/bin/ftl-trust.pem"
            ))

        try:
            msg = self.ec.create_message()
            msg.set_long("demo", 345)

            sub_msg1 = self.ec.create_message()
            sub_msg1.set_double_array("demo1", [34.5, 78.9])

            sub_msg2 = self.ec.create_message()
            sub_msg2.set_datetime("demo2", datetime.datetime.now())

            sub_msg1.set_message("sub_msg2", sub_msg2)

            msg.set_message("sub_msg1", sub_msg1)

            sub_msg3 = self.ec.create_message()
            list1 = [msg, sub_msg1]
            sub_msg3.set_message_array("array of messages", list1)

            map1 = await self.ec.create_kv_map("map1")
            await map1.set("map_field", sub_msg3)

            print("map 'map1' has been set")
            await self.ec.disconnect()
        except (EOFError, KeyboardInterrupt):
            print("\nKeyboard interrupt issued; now exiting...")
            await self.ec.disconnect()
Esempio n. 4
0
 Copyright (c) 2013-2020 TIBCO Software Inc.
 All Rights Reserved.
 For more information, please contact:
  TIBCO Software Inc., Palo Alto, California, USA
'''

import asyncio
import getopt, sys, time
from messaging.eftl.connection import Eftl

user       = "******"
password   = "******"
url        = "ws://localhost:8585/channel"
connection = None
loop       = None
eFTL       = Eftl()
error      = False
requestTimeout = 60 * 60  # wait for 1 hour for reply (60 * 60 seconds)

def usage():
    print (usage_lines)
    sys.exit(0)

usage_lines = """
        Usage: python3 request.py [options] url
        Options:
        \t-user        <str>    Username for authentication
        \t-password    <str>    Password for authentication
      """

def parseArgs(argv):