Understanding an AMF Polling call

故事扮演 提交于 2019-12-11 06:48:48

问题


One of my testers is asking me about an AMF polling that we do in our app:

flex_amf_call(
    "AMF3_call_12",
    "Gateway=http://test.url.com:22000/InventoryTesting/boa/messagebroker/amfpolling",
    "Snapshot=t19.inf",
    MESSAGE,
    "Method=null",
    "TargetObjectId=/7",
    BEGIN_ARGUMENTS,
    "<AMF3><object-externalizable-custom><flex.messaging.messages.CommandMessage>\n  "
    "<destination>InvTestMessaging</destination>\n  <messageId>"
    "4AF91854-F89E-F56D-EE22-4EC8BBAEA4BC</messageId>\n  <timestamp>0</timestamp>\n  "
    "<timeToLive>0</timeToLive>\n  <headers>\n    <entry>\n      <string>"
    "DSEndpoint</string>\n      <string>my-polling-amf</string>\n    </entry>\n    "
    "<entry>\n      <string>DSId</string>\n      <string>{ParamDSValue_string}"
    "</string>\n    </entry>\n  </headers>\n  <body serialization=\"custom\" class="
    "\"flex.messaging.io.amf.ASObject\">\n    <unserializable-parents/>\n    <map>\n "
    "     <default>\n        <loadFactor>0.75</loadFactor>\n        <threshold>"
    "12</threshold>\n      </default>\n      <int>16</int>\n      <int>0</int>\n    "
    "</map>\n    <flex.messaging.io.amf.ASObject>\n      <default>\n        "
    "<inHashCode>false</inHashCode>\n        <inToString>false</inToString>\n      "
    "</default>\n    </flex.messaging.io.amf.ASObject>\n  </body>\n  <correlationId/>"
    "\n  <operation>0</operation>\n</flex.messaging.messages.CommandMessage>"
    "</object-externalizable-custom></AMF3>",
    END_ARGUMENTS,
    LAST);

What does this node mean?

<operation>

They are seeing values of 0 and 5.


回答1:


A CommandMessage with an operation of 0 is a "subscribe" operation, and is sent automatically when a session is initiated with the server under certain circumstances. A CommandMessage with an operation of 5 is a "ping" operation, and the server must respond with an appropriately populated AcknowledgeMessage or AMF communication is terminated. A CommandMessage is automatically sent by the flash player as needed, and whatever server you're using should be appropriately configured to automatically handle them, or provide hooks for their handling (like with login and logout operations).

See http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/messages/CommandMessage.html for more details about the CommandMessage.



来源:https://stackoverflow.com/questions/7476562/understanding-an-amf-polling-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!