Exemplo n.º 1
0
def listall_topics():
    prepareResponse = PrepareResponse()
    topicConsumer = TopicConsumer()
    topicConsumer.listAllTopics(prepareResponse)
    response = app.response_class(response=prepareResponse.getResponseMsg(),
                                  status=prepareResponse.getResponseCode(),
                                  mimetype='application/json')
    return response
Exemplo n.º 2
0
def topic_details(topic):
    topic == request.view_args['topic']
    prepareResponse = PrepareResponse()
    topicConsumer = TopicConsumer()
    topicConsumer.getTopicDetails(prepareResponse, topic)
    response = app.response_class(response=prepareResponse.getResponseMsg(),
                                  status=prepareResponse.getResponseCode(),
                                  mimetype='application/json')
    return response
Exemplo n.º 3
0
def get_events(topic, consumergroup, consumerid):
    topic == request.view_args['topic']
    consumergroup == request.view_args['consumergroup']
    consumerid == request.view_args['consumerid']
    limit = ""
    timeout = ""

    if 'limit' in request.args:
        limit = request.args['limit']
    if 'timeout' in request.args:
        timeout = request.args['timeout']

    prepareResponse = PrepareResponse()
    eventConsumer = EventConsumer()
    eventConsumer.consumeEvents(prepareResponse, topic,
                                consumergroup, consumerid, getLimit(limit),
                                getTimeout(timeout))
    response = app.response_class(response=prepareResponse.getResponseMsg(),
                                  status=prepareResponse.getResponseCode(),
                                  mimetype='application/json')
    return response