[akka-user] Re: Getting an array of formFields

2015-12-08 Thread André
Hi Jacobus,

it's currently not possible to extract a sequence of values with the 
formFields directive. See this post[1] on how to extract all form fileds.

FYI: akka-http recently added the * receptacle to extract sequences. [2]

[1] https://groups.google.com/d/msg/spray-user/Uqp0C0hOMvQ/rxQy0crJ_70J
[2] https://github.com/akka/akka/pull/17107

Cheers
André


On Monday, December 7, 2015 at 11:24:50 PM UTC+1, Jacobus wrote:
>
> Hi guys,
>
> I receive message content from a monitoring device in a formal like this:
>
> POST /monitor/status HTTP/1.1   
> Host: testingtesting.com 
> Connection: 
> Keep-Alive  
> Content-Type: 
> application/x-www-form-urlencoded 
> Authorization: Basic cmVtb3RlX2 cmVtb3RlX2NsaWVudNsaWVud= 
>   
>
> Content-Length: 78  
>   
>   
>   
>
> &reading[0]=0004A38E5835;   
> &reading[1]=0004A3D3F18B; 
>   
>
> &reading[2]=0004A3D3F18B; 
>  
>
>
> Now if there was only one reading, then I could just use:
>
> formFields('reading) { reading =>
>   complete {
> logger.debug("Monitoring data received: " + reading)
> 
>}
>
> But what is the best way to access an array of measurements like the ones 
> above. Is there some sort of directive available for this?
>
> Thanks in advance. I hope there is someone out there who had a little more 
> coffee than me.
>
> Kind regards,
> Jacobus
>

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] loading actors routing from configuration file

2015-12-08 Thread ash.ta
hi,

continuing to bother you with newbie questions :)

i'm trying to define actors routing via conf file.

my application.conf:

akka {
  akka.actor.deployment {
   /ReceiveActor {
 router = "round-robin-pool"
 nr-of-instances = 5
   }
 }
}


the code initializing the actorref:

system.actorOf( FromConfig.getInstance().props( Props.create( 
ReceiveActor.class ) ), ReceiveActor.class.getSimpleName() )


always getting the following error:

akka.ConfigurationException: Configuration missing for router 
[akka://mysystem/user/ReceiveActor] in 'akka.actor.deployment' section.


i tried to play with the conf file changing /ReceiveActor path to 
/user/ReceiveACtor etc., but with no luck.
thanks for help.

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] loading actors routing from configuration file

2015-12-08 Thread Martynas Mickevičius
Hi. You have double nested *akka* in your config file. :)

On Tue, Dec 8, 2015 at 11:22 AM, ash.ta  wrote:

> hi,
>
> continuing to bother you with newbie questions :)
>
> i'm trying to define actors routing via conf file.
>
> my application.conf:
>
> akka {
>   akka.actor.deployment {
>/ReceiveActor {
>  router = "round-robin-pool"
>  nr-of-instances = 5
>}
>  }
> }
>
>
> the code initializing the actorref:
>
> system.actorOf( FromConfig.getInstance().props( Props.create( 
> ReceiveActor.class ) ), ReceiveActor.class.getSimpleName() )
>
>
> always getting the following error:
>
> akka.ConfigurationException: Configuration missing for router
> [akka://mysystem/user/ReceiveActor] in 'akka.actor.deployment' section.
>
>
> i tried to play with the conf file changing /ReceiveActor path to
> /user/ReceiveACtor etc., but with no luck.
> thanks for help.
>
> --
> >> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martynas Mickevičius
Typesafe  – Reactive
 Apps on the JVM

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] loading actors routing from configuration file

2015-12-08 Thread ash.ta
thanks martynas!

i thought akka.actor.deployment is a constant property name.

all works now.
cheers.

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] loading actors routing from configuration file

2015-12-08 Thread Martynas Mickevičius
It is a path to a setting. The following two configs are identical:

akka.actor.deployment {
   ...
}

akka {
  actor {
deployment {
  ...
}
  }
}

On Tue, Dec 8, 2015 at 3:22 PM, ash.ta  wrote:

> thanks martynas!
>
> i thought akka.actor.deployment is a constant property name.
>
> all works now.
> cheers.
>
> --
> >> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Martynas Mickevičius
Typesafe  – Reactive
 Apps on the JVM

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Getting an array of formFields

2015-12-08 Thread André
Oops, wrong list!

Just use .* (see 
http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0-M2/scala/http/routing-dsl/directives/form-field-directives/formFields.html)

HTH
André

On Tuesday, December 8, 2015 at 10:17:07 AM UTC+1, André wrote:
>
> Hi Jacobus,
>
> it's currently not possible to extract a sequence of values with the 
> formFields directive. See this post[1] on how to extract all form fileds.
>
> FYI: akka-http recently added the * receptacle to extract sequences. [2]
>
> [1] https://groups.google.com/d/msg/spray-user/Uqp0C0hOMvQ/rxQy0crJ_70J
> [2] https://github.com/akka/akka/pull/17107
>
> Cheers
> André
>
>
> On Monday, December 7, 2015 at 11:24:50 PM UTC+1, Jacobus wrote:
>>
>> Hi guys,
>>
>> I receive message content from a monitoring device in a formal like this:
>>
>> POST /monitor/status HTTP/1.1   
>> Host: testingtesting.com 
>> Connection: 
>> Keep-Alive  
>> Content-Type: 
>> application/x-www-form-urlencoded 
>> Authorization: Basic cmVtb3RlX2 cmVtb3RlX2NsaWVudNsaWVud=
>>
>>
>> Content-Length: 78  
>>   
>>  
>>
>>
>> &reading[0]=0004A38E5835;   
>> &reading[1]=0004A3D3F18B;
>>
>>
>> &reading[2]=0004A3D3F18B;
>>   
>>
>>
>> Now if there was only one reading, then I could just use:
>>
>> formFields('reading) { reading =>
>>   complete {
>> logger.debug("Monitoring data received: " + reading)
>> 
>>}
>>
>> But what is the best way to access an array of measurements like the ones 
>> above. Is there some sort of directive available for this?
>>
>> Thanks in advance. I hope there is someone out there who had a little 
>> more coffee than me.
>>
>> Kind regards,
>> Jacobus
>>
>

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Getting an array of formFields

2015-12-08 Thread Jacobus
Thanks so much Andre!

This was exactly what I was looking for.

Kind regards,
Jacobus



On Tue, Dec 8, 2015 at 6:15 PM, André  wrote:

> Oops, wrong list!
>
> Just use .* (see
> http://doc.akka.io/docs/akka-stream-and-http-experimental/2.0-M2/scala/http/routing-dsl/directives/form-field-directives/formFields.html
> )
>
> HTH
> André
>
>
> On Tuesday, December 8, 2015 at 10:17:07 AM UTC+1, André wrote:
>>
>> Hi Jacobus,
>>
>> it's currently not possible to extract a sequence of values with the
>> formFields directive. See this post[1] on how to extract all form fileds.
>>
>> FYI: akka-http recently added the * receptacle to extract sequences. [2]
>>
>> [1] https://groups.google.com/d/msg/spray-user/Uqp0C0hOMvQ/rxQy0crJ_70J
>> [2] https://github.com/akka/akka/pull/17107
>>
>> Cheers
>> André
>>
>>
>> On Monday, December 7, 2015 at 11:24:50 PM UTC+1, Jacobus wrote:
>>>
>>> Hi guys,
>>>
>>> I receive message content from a monitoring device in a formal like this:
>>>
>>> POST /monitor/status HTTP/1.1
>>> Host: testingtesting.com
>>>
>>> Connection:
>>> Keep-Alive
>>> Content-Type:
>>> application/x-www-form-urlencoded
>>> Authorization: Basic cmVtb3RlX2 cmVtb3RlX2NsaWVudNsaWVud=
>>>
>>> Content-Length: 78
>>>
>>>
>>>
>>> &reading[0]=0004A38E5835;
>>> &reading[1]=0004A3D3F18B;
>>>
>>> &reading[2]=0004A3D3F18B;
>>>
>>>
>>> Now if there was only one reading, then I could just use:
>>>
>>> formFields('reading) { reading =>
>>>   complete {
>>> logger.debug("Monitoring data received: " + reading)
>>> 
>>>}
>>>
>>> But what is the best way to access an array of measurements like the
>>> ones above. Is there some sort of directive available for this?
>>>
>>> Thanks in advance. I hope there is someone out there who had a little
>>> more coffee than me.
>>>
>>> Kind regards,
>>> Jacobus
>>>
>> --
> >> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/Wzd6MxAi1UI/unsubscribe.
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Disable relative URI parsing in Akka HTTP?

2015-12-08 Thread Tim Harper
I saw the docs, yes (mentioned it in my original post). Use case is I have an 
api which Acts as a key value store, and rather than passing in the key via a 
query string param, I'm passing it in via the Path, and would prefer to not 
have path normalization occur.

The raw param will suit my needs fine :) thanks!

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Disable relative URI parsing in Akka HTTP?

2015-12-08 Thread Tim Harper
I saw the docs, yes (mentioned it in my original post). Use case is I have an 
api which Acts as a key value store, and rather than passing in the key via a 
query string param, I'm passing it in via the Path, and would prefer to not 
have path normalization occur.

The raw param will suit my needs fine :) thanks!

-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Disable relative URI parsing in Akka HTTP?

2015-12-08 Thread Roland Kuhn
Ah, so you’re only cheating a little ;-)

> 9 dec 2015 kl. 07:18 skrev Tim Harper :
> 
> I saw the docs, yes (mentioned it in my original post). Use case is I have an 
> api which Acts as a key value store, and rather than passing in the key via a 
> query string param, I'm passing it in via the Path, and would prefer to not 
> have path normalization occur.
> 
> The raw param will suit my needs fine :) thanks!
> 
> -- 
>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.