当前位置: 首页>>代码示例>>Python>>正文


Python Stomp.subscribe方法代码示例

本文整理汇总了Python中stompest.sync.Stomp.subscribe方法的典型用法代码示例。如果您正苦于以下问题:Python Stomp.subscribe方法的具体用法?Python Stomp.subscribe怎么用?Python Stomp.subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stompest.sync.Stomp的用法示例。


在下文中一共展示了Stomp.subscribe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _test_4_integration_stomp

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def _test_4_integration_stomp(self, version):
        client = Stomp(self.getConfig(version))
        try:
            client.connect(host=VIRTUALHOST, versions=[version])
        except StompProtocolError as e:
            print('Broker does not support STOMP protocol %s. Skipping this test case. [%s]' % (e, version))
            return

        client.send(self.DESTINATION, b'test message 1')
        client.send(self.DESTINATION, b'test message 2')
        self.assertFalse(client.canRead(self.TIMEOUT))
        token = client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.unsubscribe(token)
        client.send(self.DESTINATION, b'test message 3', receipt='4711')
        self.assertTrue(client.canRead(self.TIMEOUT))
        self.assertEqual(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {StompSpec.RECEIPT_ID_HEADER: '4711'}))
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.disconnect(receipt='4712')
        self.assertEqual(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {StompSpec.RECEIPT_ID_HEADER: '4712'}))
        self.assertRaises(StompConnectionError, client.receiveFrame)
        client.connect(host=VIRTUALHOST)
        client.disconnect(receipt='4711')
        self.assertEqual(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {StompSpec.RECEIPT_ID_HEADER: '4711'}))
        client.close()
        self.assertRaises(StompConnectionError, client.canRead, 0)
开发者ID:nikipore,项目名称:stompest,代码行数:36,代码来源:sync_client_integration_test.py

示例2: main

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
def main():
    logging.basicConfig()
    logging.getLogger().setLevel(logging.WARN)

    client = Stomp(stomp_config)
    client.connect()
    client.send(stomp_queue, body=stomp_body)
    client.subscribe(stomp_queue, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT, 'activemq.prefetchSize': 1})
    if client.canRead(timeout=5):
        frame = client.receiveFrame()
        print 'Got %s' % frame.info()
        client.ack(frame)
        frame_body = str(frame.body)
        if frame_body == stomp_body:
            print "OK: Message received"
            status = 'ok'
        else:
            print "WARNING: Incorrect message body; is %s, should be %s" % (frame_body, stomp_body)
            status = 'warning'
    else:
        print "CRITICAL: Timed out while trying to collect the message"
        status = 'critical'
    client.disconnect()
    client.close(flush=True)
    return exit_codes[status]
开发者ID:soalhn,项目名称:icinga-plugins-soal,代码行数:27,代码来源:check_activemq.py

示例3: test_4_integration_stomp_1_1

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def test_4_integration_stomp_1_1(self):
        if StompSpec.VERSION_1_1 not in commands.versions(VERSION):
            print 'This broker does not support STOMP protocol version 1.1'
            return

        client = Stomp(self.getConfig(StompSpec.VERSION_1_1))
        client.connect(host=VIRTUALHOST)

        client.send(self.DESTINATION, 'test message 1')
        client.send(self.DESTINATION, 'test message 2')
        self.assertFalse(client.canRead(self.TIMEOUT))
        token = client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: 'client-individual'})
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.unsubscribe(token)
        client.send(self.DESTINATION, 'test message 3', receipt='4711')
        self.assertTrue(client.canRead(self.TIMEOUT))
        self.assertEquals(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {'receipt-id': '4711'}))
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: 'client-individual'})
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.disconnect(receipt='4712')
        self.assertEquals(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {'receipt-id': '4712'}))
        self.assertRaises(StompConnectionError, client.receiveFrame)
        client.connect(host=VIRTUALHOST)
        client.disconnect(receipt='4711')
        self.assertEquals(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {'receipt-id': '4711'}))
        client.close()
        self.assertRaises(StompConnectionError, client.canRead, 0)
开发者ID:irdetoakinavci,项目名称:AMQMessageProducer,代码行数:36,代码来源:sync_client_integration_test.py

示例4: configureClient

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def configureClient(self, _login, _passcode):
        CONFIG = StompConfig("tcp://datafeeds.networkrail.co.uk:61618", login=_login, passcode=_passcode)

        client = Stomp(CONFIG)
        client.connect()
        client.subscribe("/topic/TD_KENT_MCC_SIG_AREA")

        self._client = client
开发者ID:sparky18,项目名称:networkrail,代码行数:10,代码来源:watch.py

示例5: recv_stomp

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
def recv_stomp ():
    config = StompConfig (stomp_uri)
    client = Stomp (config)
    client.connect ()
    client.subscribe (stomp_source, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
    frame = client.receiveFrame ()
    print "Received: {}".format (frame.info ())
    client.ack (frame)
    client.disconnect ()
开发者ID:jpbarto,项目名称:stomp_eval,代码行数:11,代码来源:stompest-test.py

示例6: setUp

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
 def setUp(self):
     config = self.getConfig(StompSpec.VERSION_1_0)
     client = Stomp(config)
     client.connect(host=VIRTUALHOST)
     client.subscribe(self.DESTINATION, {StompSpec.ACK_HEADER: StompSpec.ACK_AUTO})
     client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 'bla', StompSpec.ACK_HEADER: StompSpec.ACK_AUTO})
     while client.canRead(self.TIMEOUT):
         frame = client.receiveFrame()
         self.log.debug('Dequeued old %s' % frame.info())
     client.disconnect()
开发者ID:nikipore,项目名称:stompest,代码行数:12,代码来源:sync_client_integration_test.py

示例7: run

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def run(self):
        if(processgid > 0): os.setgid(processgid)
        if(processuid > 0): os.setuid(processuid)
        config = StompConfig('tcp://%(HOST)s:%(PORT)s' % ActiveMQ)
        topic = "/topic/%(FILESYNCTOPIC)s" % ActiveMQ
        client = Stomp(config)
        self.logger = logging.getLogger('nfssync') 
        self.logger.setLevel(logging.DEBUG)
        handler = TimedRotatingFileHandler(LOGFILE, when='midnight', interval=1, backupCount=30)
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        handler.setFormatter(formatter)
        self.logger.addHandler(handler)

        try:
            client.connect()
            client.subscribe(topic, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})

            while True:
                frame = client.receiveFrame()
                subdir = frame.body

                srcpath = os.path.join(ActiveMQ['SRCDIR'], subdir)
                dstpath = os.path.dirname(os.path.join(ActiveMQ['DSTDIR'], subdir))
                self.logger.info("Syncing %s to %s" % (srcpath,dstpath))
                if(not os.path.exists(srcpath)):
                    msg = "Source %s does not exist" % srcpath
                    self.logger.error(msg)
                    proxy_email(email_subject_error, msg)
                    client.ack(frame)
                    continue
                elif(not os.path.isdir(srcpath)):
                    msg = "Source %s is not a directory" % srcpath
                    self.logger.error(msg)
                    proxy_email(email_subject_error, msg)
                    client.ack(frame)
                    continue
                elif(not os.path.exists(dstpath)):
                    msg = "Destination %s does not exist" % dstpath
                    self.logger.warning(msg)
                    proxy_email(email_subject_warning, msg)
                    os.umask(0)
                    os.makedirs(dstpath, 0777)
                cmd = "rsync -avzq --delete %s %s" % (srcpath,dstpath)
                if(call(cmd, shell=True) > 0):
                    msg = "Sync %s failed" % cmd
                    self.logger.error(msg)
                    proxy_email(email_subject, msg)
                client.ack(frame)
                    
        except Exception, e:
            msg = "Exception in %s: %s" % (sys.argv[0], str(e))
            self.logger.error(msg)
            proxy_email(email_subject_error, msg)
            exit(1)
开发者ID:itay-moav,项目名称:talis,代码行数:56,代码来源:nfssync.py

示例8: test_1_integration

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def test_1_integration(self):
        config = self.getConfig(StompSpec.VERSION_1_0)
        client = Stomp(config)
        client.connect(host=VIRTUALHOST)

        client.send(self.DESTINATION, b'test message 1')
        client.send(self.DESTINATION, b'test message 2')
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.subscribe(self.DESTINATION, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertTrue(client.canRead(self.TIMEOUT))
        client.ack(client.receiveFrame())
        self.assertFalse(client.canRead(self.TIMEOUT))
开发者ID:nikipore,项目名称:stompest,代码行数:16,代码来源:sync_client_integration_test.py

示例9: connect_to_amq

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
def connect_to_amq(tb, queue=False, topic=False):
    # Format the connection url
    dl_ff_ip, dl_north_rest = tb.dl_northside_rest.split(":")
    dl_activemq_stomp_port = 61613
    url = "tcp://{}:{}".format(dl_ff_ip, dl_activemq_stomp_port)
    # Create stomp config
    config = StompConfig(url)
    stomp = Stomp(config)
    # Connect to activemq
    stomp.connect()
    if queue:
        stomp.subscribe(queue, {StompSpec.ID_HEADER: u'testbench'})
    elif topic:
        stomp.subscribe('/topic/' + str(topic), {StompSpec.ID_HEADER: u'testbench'})
    # return the stomp
    return stomp
开发者ID:suryatejah,项目名称:testing,代码行数:18,代码来源:test_demo.py

示例10: test_6_integration_stomp_1_1_encoding_and_escaping_headers

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def test_6_integration_stomp_1_1_encoding_and_escaping_headers(self):
        if BROKER == 'rabbitmq':
            print('Broker does not support unicode characters. Skipping this test case.')
            return

        version = StompSpec.VERSION_1_1
        client = Stomp(self.getConfig(version))
        try:
            client.connect(host=VIRTUALHOST, versions=[version])
        except StompProtocolError as e:
            print('Broker does not support STOMP protocol %s. Skipping this test case. [%s]' % (e, version))
            return

        key = b'fen\xc3\xaatre'.decode('utf-8')
        value = b'\xc2\xbfqu\xc3\xa9 tal?'.decode('utf-8')
        headers = {key: value}
        client.send(self.DESTINATION, body=b'test message 1', headers=headers)
        self.assertFalse(client.canRead(self.TIMEOUT))
        token = client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertTrue(client.canRead(self.TIMEOUT))
        frame = client.receiveFrame()
        client.ack(frame)
        self.assertEqual(frame.version, version)
        self.assertEqual(frame.headers[key], headers[key])
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.unsubscribe(token)
        client.disconnect(receipt='4712')
开发者ID:nikipore,项目名称:stompest,代码行数:29,代码来源:sync_client_integration_test.py

示例11: call_route

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
def call_route(request_queue, response_queue, request):
    """
    """
    config = {
        "stomp": {
            "server": '192.168.0.3',
            "port": 61613,
            "timeout": 15,
        }
    }

    stomp_config = StompConfig("tcp://%s:%d" % (config['stomp']['server'], config['stomp']['port']), version=StompSpec.VERSION_1_0)
    stomp = Stomp(stomp_config)
    stomp.connect()
  
    jms_id = str(uuid4())
    token = stomp.subscribe(response_queue, {'JMSCorrelationID': jms_id})
    stomp.send(request_queue, json.dumps(request), {'JMSCorrelationID': jms_id})

    response = None
    if stomp.canRead(config['stomp']['timeout']):
        response = stomp.receiveFrame()
    
    stomp.unsubscribe(token)
    return response
开发者ID:siwells,项目名称:sandpit,代码行数:27,代码来源:stomptest.py

示例12: test_6_integration_stomp_1_1_encoding_and_escaping_headers

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def test_6_integration_stomp_1_1_encoding_and_escaping_headers(self):
        if BROKER == 'rabbitmq':
            print 'Broker does not support unicode characters. Skipping this test case.'
            return

        version = StompSpec.VERSION_1_1
        client = Stomp(self.getConfig(version))
        try:
            client.connect(host=VIRTUALHOST, versions=[version])
        except StompProtocolError as e:
            print 'Broker does not support STOMP protocol %s. Skipping this test case. [%s]' % (e, version)
            return

        specialCharactersHeader = u'fen\xeatre:\r\n'
        headers = {specialCharactersHeader: u'\xbfqu\xe9 tal?, s\xfc\xdf'}
        client.send(self.DESTINATION, body='test message 1', headers=headers)
        self.assertFalse(client.canRead(self.TIMEOUT))
        token = client.subscribe(self.DESTINATION, {StompSpec.ID_HEADER: 4711, StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertTrue(client.canRead(self.TIMEOUT))
        frame = client.receiveFrame()
        client.ack(frame)
        self.assertEquals(frame.version, version)
        self.assertEquals(frame.headers[specialCharactersHeader], headers[specialCharactersHeader])
        self.assertFalse(client.canRead(self.TIMEOUT))
        client.unsubscribe(token)
        client.disconnect(receipt='4712')
开发者ID:anthony-cervantes,项目名称:stompest,代码行数:28,代码来源:sync_client_integration_test.py

示例13: main

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-a', action='store_true', default=False, help='client ack')
    parser.add_argument('-b', action='store_true', default=False, help='write body only')
    parser.add_argument('-d', nargs=1, required=True, help='destination', metavar='dest')
    parser.add_argument('-f', nargs=1, required=True, help='file with recorded msgs', metavar='file')
    parser.add_argument('-n', nargs=1, default=False, help='number of msgs', metavar='int')
    parser.add_argument('-r', action='store_true', default=False, help='reconnect')
    parser.add_argument('-s', nargs=1, required=True, help='broker', metavar='broker')
    parser.add_argument('-t', nargs=1, default=False, help='recv msg every sec', metavar='float')
    args = parser.parse_args()

    broker = 'tcp://%s:6163' % (args.s[0])
    config = StompConfig(broker)

    client = Stomp(config)
    if not args.r:
        client.connect()
        if args.a:
            client.subscribe(args.d[0], {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        else:
            client.subscribe(args.d[0], {StompSpec.ACK_HEADER: StompSpec.ACK_AUTO})
    try:
        consumed = 0
        while True:
            if args.r:
                client.connect()
                if args.a:
                    client.subscribe(args.d[0], {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
                else:
                    client.subscribe(args.d[0], {StompSpec.ACK_HEADER: StompSpec.ACK_AUTO})
            if args.t:
                time.sleep(float(args.t[0]))
            else:
                time.sleep(1)
            fo = open(args.f[0], 'a+')
            frame = client.receiveFrame()
            consumed += 1
            if args.b:
                fo.write(frame.body+'\n')
            else:
                fo.write(frame.info()+'\n')
            fo.close()
            if args.a:
                client.ack(frame)
            if args.r:
                client.disconnect()
            if args.n:
                if consumed == int(args.n[0]):
                    raise KeyboardInterrupt
    except KeyboardInterrupt:
        client.stop()
        client.disconnect()
        raise SystemExit(1)
    except stompest.error.StompProtocolError:
        pass
开发者ID:vrdel,项目名称:brokers-test,代码行数:58,代码来源:consumer.py

示例14: test_2_transaction

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
    def test_2_transaction(self):
        config = self.getConfig(StompSpec.VERSION_1_0)
        client = Stomp(config)
        client.connect(host=VIRTUALHOST)
        client.subscribe(self.DESTINATION, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL})
        self.assertFalse(client.canRead(self.TIMEOUT))

        with client.transaction(4711) as transaction:
            self.assertEqual(transaction, '4711')
            client.send(self.DESTINATION, b'test message', {StompSpec.TRANSACTION_HEADER: transaction})
            self.assertFalse(client.canRead(0))
        self.assertTrue(client.canRead(self.TIMEOUT))
        frame = client.receiveFrame()
        self.assertEqual(frame.body, b'test message')
        client.ack(frame)

        with client.transaction(4713, receipt='4712') as transaction:
            self.assertEqual(transaction, '4713')
            self.assertEqual(client.receiveFrame(), StompFrame(StompSpec.RECEIPT, {StompSpec.RECEIPT_ID_HEADER: '4712-begin'}))
            client.send(self.DESTINATION, b'test message', {StompSpec.TRANSACTION_HEADER: transaction})
            client.send(self.DESTINATION, b'test message without transaction')
            self.assertTrue(client.canRead(self.TIMEOUT))
            frame = client.receiveFrame()
            self.assertEqual(frame.body, b'test message without transaction')
            client.ack(frame)
            self.assertFalse(client.canRead(0))
        frames = [client.receiveFrame() for _ in range(2)]
        frames = list(sorted(frames, key=lambda f: f.command))
        frame = frames[0]
        client.ack(frame)
        self.assertEqual(frame.body, b'test message')
        frame = frames[1]
        self.assertEqual(frame, StompFrame(StompSpec.RECEIPT, {StompSpec.RECEIPT_ID_HEADER: '4712-commit'}))

        try:
            with client.transaction(4714) as transaction:
                self.assertEqual(transaction, '4714')
                client.send(self.DESTINATION, b'test message', {StompSpec.TRANSACTION_HEADER: transaction})
                raise RuntimeError('poof')
        except RuntimeError as e:
            self.assertEqual(str(e), 'poof')
        else:
            raise
        self.assertFalse(client.canRead(self.TIMEOUT))

        client.disconnect()
开发者ID:nikipore,项目名称:stompest,代码行数:48,代码来源:sync_client_integration_test.py

示例15: test_3_socket_failure_and_replay

# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import subscribe [as 别名]
 def test_3_socket_failure_and_replay(self):
     client = Stomp(self.getConfig(StompSpec.VERSION_1_0))
     client.connect(host=VIRTUALHOST)
     headers = {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL}
     token = client.subscribe(self.DESTINATION, headers)
     client.sendFrame(StompFrame(StompSpec.DISCONNECT)) # DISCONNECT frame is out-of-band, as far as the session is concerned -> unexpected disconnect
     self.assertRaises(StompConnectionError, client.receiveFrame)
     client.connect(host=VIRTUALHOST)
     client.send(self.DESTINATION, b'test message 1')
     client.ack(client.receiveFrame())
     client.unsubscribe(token)
     headers = {StompSpec.ID_HEADER: 'bla', StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL}
     client.subscribe(self.DESTINATION, headers)
     headers[StompSpec.DESTINATION_HEADER] = self.DESTINATION
     client.sendFrame(StompFrame(StompSpec.DISCONNECT)) # DISCONNECT frame is out-of-band, as far as the session is concerned -> unexpected disconnect
     self.assertRaises(StompConnectionError, client.receiveFrame)
     client.connect(host=VIRTUALHOST)
     client.send(self.DESTINATION, b'test message 2')
     client.ack(client.receiveFrame())
     client.unsubscribe((StompSpec.ID_HEADER, 'bla'))
     client.disconnect()
开发者ID:nikipore,项目名称:stompest,代码行数:23,代码来源:sync_client_integration_test.py


注:本文中的stompest.sync.Stomp.subscribe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。