Thanks but I don't understand how I can make the request id available 
inside the rest of the route. 

On Thursday, August 24, 2017 at 4:08:01 AM UTC-5, Arnout Engelen wrote:
>
> Hello,
>
> You could create a Directive1[UUID] which can then be used like this:
>
> withRequestId { requestId =>
>   pathSingleSlash {
>     comlete(requestId.toString)
>   }
> }
>
> Is that what you're looking for? See 
> http://doc.akka.io/docs/akka-http/10.0.9/scala/http/routing-dsl/directives/custom-directives.html#directives-from-scratch
>  
> for more details.
>
>
> Kind regards,
>
> Arnout
>
> On Thu, Aug 24, 2017 at 1:55 AM, kraythe <kra...@gmail.com <javascript:>> 
> wrote:
>
>> Greetings, 
>>
>> I am currently using the low level API but lookign again at the DSL. I 
>> have been trying to figure out if there is a way to create a directive that 
>> creates a unique request UUID and allows other directives to access that 
>> UUID in every sub directive. Basically I want something like 
>>
>> withRequestId {
>>   requestId = UUID.randomUUID()
>>   pathSingleSlash {
>>     comlete(requestId.toString)
>>   }
>> }
>>
>> I want this to be universal so the outer directive defines the id and the 
>> rest of the routes dont have to bother. I dont like copy past code. Any 
>> idea if and how this could be done? 
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Arnout Engelen
> *Senior Software Engineer*
> E: arnout....@lightbend.com <javascript:>
> T: https://twitter.com/raboofje
>
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to