1. 程式人生 > 其它 >RabbitMQ基礎一

RabbitMQ基礎一

RabbitMQ:
    安裝教程:https://rabbitmq.com/download.html
PHP安裝擴充套件:
    http://pecl.php.net/package/amqp

主要模組提供方法:
connection:
    isConnected()
    connect()
    pconnect()
    pdisconnect()
    disconnect()
    reconnect()
    preconnect()
    getLogin()
    setLogin(string login)
    getPassword()
    setPassword(string password)
    getHost()
    setHost(sting host)
    getPort()
    setPort(mixed port)
    getVhost()
    setVhost(string vhost)
    getTimeout()
    setTimeout(double timeout)
    getReadTimeout()
    setReadTimeout(double timeout)
    getWriteTimeout()
    setWriteTimeout(double timeout)
    getRpcTimeout()
    setRpcTimeout(double timeout)
    getUsedChannels()
    getMaxChannels()
    getMaxFrameSize()
    getHeartbeatInterval()
    isPersistent()
    getCACert()
    setCACert(string cacert)
    getCert()
    setCert()
    getKey()
    setKey(string key)
    getVerify()
    setVerify(bool verify)
    getSaslMethod()
    setSaslMethod(mixed method)
    getConnectionName()
    setConnectionName(string connectionname)
channel:
    getChannelId()
    isConnected()
    close()
    setPrefetchCount(long count)
    getPrefetchCount()
    setPrefetchSize(long size)
    getPrefetchSize()
    setGlobalPrefetchCount(long count)
    getGlobalPrefetchCount()
    setGlobalPrefetchSize(long size)
    getGlobalPrefetchSize()
    qos(long size, long count, bool global)
    startTransaction()
    commitTransaction()
    rollbackTransaction()
    getConnection()
    basicRecover([bool requeue=TRUE])
    confirmSelect()
    setReturnCallback(callable return_callback)
    waitForBasicReturn([double timeout=0.0])
    setConfirmCallback(callable ack_callback [, callable nack_callback = null])
    waitForConfirm([double timeout=0.0])
    getConsumers()
    
exchange:
    getName()
    setName(string name)
    getFlags()
    setFlags(long bitmask) AMQP_PASSIVE AMQP_DURABLE AMQP_AUTODELETE AMQP_INTERNAL
    getType()
    setType(string type)
    getArgument(string key)
    hasArgument(string key)
    getArguments()
    setArguments(array args)
    setArgument(key,value)
    declareExchange()
    delete([string name[, long params]])
    publish(string msg, [string key, [int flags, [array headers]]])
    bind(string srcExchangeName[, string routingKey, array arguments])
    unbind(string srcExchangeName[, string routingKey, array arguments]);
    getChannel()
    getConnection()
    
queue:
    getName()
    setName(string name)
    getFlags()
    setFlags(long bitmask)
    getArgument(string key)
    hasArgument(string key)
    getArguments()
    setArguments(array args)
    setArgument(key,value)
    declareQueue()
    bind(string exchangeName, [string routingKey, array arguments])
    get([bit flags=AMQP_NOPARAM])
    consume([callback, flags = <bitmask>, consumer_tag]);