Skip to content

Instantly share code, notes, and snippets.

@jgrgt
Created January 14, 2015 14:23
Show Gist options
  • Save jgrgt/6a10b205053119d3c715 to your computer and use it in GitHub Desktop.
Save jgrgt/6a10b205053119d3c715 to your computer and use it in GitHub Desktop.
class DefaultXConnector {
// ...
@Override
rx.Observable<JsonObject> getSessionWithTimeout(JsonObject jsonObject, long timeout) {
log.debug('Getting session with timeout {} for query: {} ({}, {})', timeout, jsonObject, this, this.eventBus)
return eventBus.sendWithTimeout(ServiceLocation.BUS_SESSION_SERVICE_LOCATION, jsonObject, timeout).map(body(true))
}
public static <T> Func1<RxMessage<T>, T> body(boolean logMessage) {
return { RxMessage<T> message ->
if (logMessage) {
log.debug('Message: {}', message)
}
return message.body()
} as Func1<RxMessage<T>, T>
}
}
13:38:05.730 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.e.DefaultXConnector - Getting session with timeout 1000000 for query: {"action":"get","application_id":"productVle","sessionId":"f0237708-af2d-4194-b839-29e0b80a228e","fields":["userid","userid","application_id","role","csrfToken","licences","tenant"]} (be.domain.product.platform.x.DefaultXConnector@74209ba5, io.vertx.rxcore.java.eventbus.RxEventBus@24e1d53c)
13:38:05.730 [vert.x-eventloop-thread-3] DEBUG b.v.d.p.e.DefaultXConnector - Getting session with timeout 1000000 for query: {"action":"get","application_id":"productVle","sessionId":"f0237708-af2d-4194-b839-29e0b80a228e","fields":["userid","userid","application_id","role","csrfToken","licences","tenant"]} (be.domain.product.platform.x.DefaultXConnector@74209ba5, io.vertx.rxcore.java.eventbus.RxEventBus@24e1d53c)
13:38:05.744 [vert.x-eventloop-thread-3] DEBUG b.v.d.p.yoke.session.SessionService - timeout observable is rx.Observable@6969ce33
13:38:05.752 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.yoke.session.SessionService - timeout observable is rx.Observable@13bab607
13:38:18.147 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.Observable$27@1aad9a93", "type": "Subscribe", "source": "rx.Observable@1dd3600f", "sourceFunc": "rx.Observable$2@5b9fe73c"}
13:38:18.147 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:18.207 [vert.x-eventloop-thread-3] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.Observable$27@4294d8b2", "type": "Subscribe", "source": "rx.Observable@5bdd9406", "sourceFunc": "rx.Observable$2@419e8966"}
13:38:18.210 [vert.x-eventloop-thread-3] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:28.532 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMap$1@4ee7e54d", "type": "OnNext", "value": "RxMessage[{\"sessionId\":\"f0237708-af2d-4194-b839-29e0b80a228e\",\"userid\":\"1\",\"application_id\":\"productVle\",\"role\":\"student\",\"csrfToken\":\"648dc6347e57576b1b50f7d3ffa805c5e320cdbe\",\"licences\":[\"83hgA8sBQiyGdN0j7jVdtw\"],\"tenant\":\"domain\",\"status\":\"ok\"}]", "to": "rx.internal.operators.OperatorMap@2b866763"}
13:38:28.532 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMap$1@4ee7e54d", "type": "OnNext", "value": "RxMessage[{\"sessionId\":\"f0237708-af2d-4194-b839-29e0b80a228e\",\"userid\":\"1\",\"application_id\":\"productVle\",\"role\":\"student\",\"csrfToken\":\"648dc6347e57576b1b50f7d3ffa805c5e320cdbe\",\"licences\":[\"83hgA8sBQiyGdN0j7jVdtw\"],\"tenant\":\"domain\",\"status\":\"ok\"}]", "to": "rx.internal.operators.OperatorMap@2b866763"}
13:38:28.533 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.Observable$27@6c5e06d4", "type": "Subscribe", "source": "rx.Observable@40c21160", "sourceFunc": "rx.Observable$2@ccbb860"}
13:38:28.533 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
// First response is received
13:38:28.533 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.e.DefaultXConnector - Message: RxMessage[{"sessionId":"f0237708-af2d-4194-b839-29e0b80a228e","userid":"1","application_id":"productVle","role":"student","csrfToken":"648dc6347e57576b1b50f7d3ffa805c5e320cdbe","licences":["83hgA8sBQiyGdN0j7jVdtw"],"tenant":"domain","status":"ok"}]
13:38:28.534 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMap$1@43a3f87f", "type": "OnNext", "value": "{\"sessionId\":\"f0237708-af2d-4194-b839-29e0b80a228e\",\"userid\":\"1\",\"application_id\":\"productVle\",\"role\":\"student\",\"csrfToken\":\"648dc6347e57576b1b50f7d3ffa805c5e320cdbe\",\"licences\":[\"83hgA8sBQiyGdN0j7jVdtw\"],\"tenant\":\"domain\",\"status\":\"ok\"}", "from": "rx.internal.operators.OperatorMap@2b866763", "to": "rx.internal.operators.OperatorMap@34f5538"}
13:38:28.534 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMap$1@43a3f87f", "type": "OnNext", "value": "{\"sessionId\":\"f0237708-af2d-4194-b839-29e0b80a228e\",\"userid\":\"1\",\"application_id\":\"productVle\",\"role\":\"student\",\"csrfToken\":\"648dc6347e57576b1b50f7d3ffa805c5e320cdbe\",\"licences\":[\"83hgA8sBQiyGdN0j7jVdtw\"],\"tenant\":\"domain\",\"status\":\"ok\"}", "from": "rx.internal.operators.OperatorMap@2b866763", "to": "rx.internal.operators.OperatorMap@34f5538"}
// further handling of the first response
13:38:28.534 [vert.x-eventloop-thread-7] DEBUG b.v.d.p.yoke.session.SessionService - Got session with ID be.domain.product.platform.yoke.session.SessionId(value:f0237708-af2d-4194-b839-29e0b80a228e) from x
13:38:28.540 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMap$1@75c8eb94", "type": "OnNext", "value": "RxMessage[{\"status\":\"ok\",\"result\":[{\"id\":\"2423904b-ec3b-482d-91f6-dcc27e555e08\"}]}]", "to": "rx.internal.operators.OperatorMap@69bc2b5f"}
13:38:28.540 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMap$1@75c8eb94", "type": "OnNext", "value": "RxMessage[{\"status\":\"ok\",\"result\":[{\"id\":\"2423904b-ec3b-482d-91f6-dcc27e555e08\"}]}]", "to": "rx.internal.operators.OperatorMap@69bc2b5f"}
13:38:28.541 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMap$1@5a5a1b35", "type": "OnNext", "value": "[be.domain.product.platform.system.domain.mail.MailTemplate@523425f2]", "from": "rx.internal.operators.OperatorMap@69bc2b5f", "to": "rx.internal.operators.OperatorMap@4073dc1b"}
13:38:28.541 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMap$1@5a5a1b35", "type": "OnNext", "value": "[be.domain.product.platform.system.domain.mail.MailTemplate@523425f2]", "from": "rx.internal.operators.OperatorMap@69bc2b5f", "to": "rx.internal.operators.OperatorMap@4073dc1b"}
13:38:28.541 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMap$1@4e4e1681", "type": "OnNext", "value": "[be.domain.product.platform.system.api.domain.mail.MailTemplateId@44472fce]", "from": "rx.internal.operators.OperatorMap@4073dc1b", "to": "rx.internal.operators.OperatorMap@372f9901"}
13:38:28.541 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMap$1@4e4e1681", "type": "OnNext", "value": "[be.domain.product.platform.system.api.domain.mail.MailTemplateId@44472fce]", "from": "rx.internal.operators.OperatorMap@4073dc1b", "to": "rx.internal.operators.OperatorMap@372f9901"}
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on {"observer": "rx.internal.operators.OperatorMerge$MergeSubscriber@5726e158", "type": "OnNext", "value": "rx.Observable@2ae29d2d", "from": "rx.internal.operators.OperatorMap@372f9901", "to": "rx.internal.operators.OperatorMerge@61ceeee1"}
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMerge$MergeSubscriber@5726e158", "type": "OnNext", "value": "rx.Observable@2ae29d2d", "from": "rx.internal.operators.OperatorMap@372f9901", "to": "rx.internal.operators.OperatorMerge@61ceeee1"}
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - start on {"observer": "rx.internal.operators.OperatorMerge$InnerSubscriber@181217e3", "type": "Subscribe", "source": "rx.Observable@2ae29d2d", "sourceFunc": "rx.Observable$2@78de1998"}
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
13:38:28.542 [vert.x-eventloop-thread-2] DEBUG b.v.d.p.s.i.r.d.Slf4jDebugNotificationListener - onNext on null
// Second response is never seen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment