Dynamic Destinations...


i been experimenting blaze , have run across interesting.

i start firefox , safari , load each browser flex app.  in flex app, have button when pushed calls server , initiates msgbroker.routemessagetoservice start streaming images client async.  works fine.  however, noticed same streaming of images playing in other browser without having push same button.  suspect due destination id being same in both browsers.

the question have how "dynamically" create destination without use of hardcoded value in messaging-config.xml. 

my flex app generate random destination id , pass server server can create destination dynamically each instance of flex app. unique.  way ask how implement messaging-config.xml entries in java code?

any real-world code examples appreciated.

messaging-config.xml...







actionscript...
con = new consumer();
con.destination = "notifications";
con.addeventlistener(messageevent.message, messagehandler);           
con.subscribe();

my java code...

messagebroker msgbroker = messagebroker.getmessagebroker(null);
string uuid = uuidutils.createuuid();
asyncmessage msg = new asyncmessage();
msg.setdestination("notifications");
msg.setclientid(uuid);
msg.setmessageid(uuidutils.createuuid());
msg.setbody(theimage);
msg.settimestamp(system.currenttimemillis());
acknowledgemessage = msgbroker.routemessagetoservice(msg, null);


More discussions in General Discussion


adobe

Comments

Popular posts from this blog

Static ip - Raspberry Pi Forums

arduino bug sur secteur, batterie, mais pas en usb?

What voltage is sent to the arduino GND when a transistor is used