【问题标题】:Flex BlazeDS dynamic configurationFlex BlazeDS 动态配置
【发布时间】:2012-06-18 15:59:43
【问题描述】:

我在这里提出一个新问题 - 这次更笼统;希望你们中的大多数人都经历过。

所以我配置了我的 flex 移动项目,以便每次更改服务器 ip 或端口时都需要更新服务器 URL 地址:

但在我的情况下,我的 flex 移动项目将在不同的医院运行,因此每次更改服务器地址时都需要进行更多更新 - 并且在医院服务器被限制在外部的情况下,从我的远程计算机上执行此操作是不可能的.因为我还需要更新远程对象类:

所以,上述方法似乎不太适合我的情况。如何配置我的项目,以便我可以通过使用 textareas 等在运行时更改服务器 url 来更改服务器 url 设置如下:

简单地说,我说的是外部化 AMF 通道端点 url 的配置。

任何帮助将不胜感激!...

【问题讨论】:

    标签: actionscript-3 apache-flex flex4 blazeds flex-mobile


    【解决方案1】:

    您可以自己构建消息消费者并指定正确的渠道:

    function initConsumer():void { 
      var channelSet:ChannelSet = new ChannelSet();
      // for streaming
      var myChannel:Channel = new StreamingAMFChannel("streaming-channel", "http://something.com/messagebroker/");
      // for polling
      var myChannel:Channel = new AMFChannel("polling-channel", "http://something.com/messagebroker/");
      myChannel.pollingEnabled = true;
    
      channelSet.addChannel(myChannel);
    
      var consumer:Consumer = new Consumer();
      consumer.channelSet = channelSet;
      consumer.destination = "NASDAQ"; 
      consumer.selector = "operation IN ('Bid','Ask')";
      consumer.addEventListener(MessageEvent.MESSAGE, messageHandler); 
      consumer.subscribe(); 
    } 
    
    function messageHandler(event:MessageEvent):void { 
      var msg:IMessage = event.message; 
      var info:Object = msg.body; 
      trace("-App recieved message: " + msg.toString()); 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多