[akka-user] akka-http HttpService equivalent

2014-12-09 Thread Stevo Slavić
Hello Akka community,

In akka-http, is there an equivalent to spray.routing.HttpService?

Kind regards,
Stevo Slavic.

-- 
>>  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] akka-http HttpService equivalent

2014-12-10 Thread Björn Antonsson
Hi Stevo,

There is no direct equivalent to the spray.routing.HttpService. The closest is 
probably the akka.http.server.japi.HttpService and 
akka.http.server.japi.HttpApp.

B/

On 9 December 2014 at 16:04:57, Stevo Slavić (ssla...@gmail.com) wrote:

Hello Akka community,

In akka-http, is there an equivalent to spray.routing.HttpService?

Kind regards,
Stevo Slavic.
--
>> 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.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
>>  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] akka-http HttpService equivalent

2014-12-23 Thread Stevo Slavić
Thanks! Thought akka-http-java-experimental was java only APIs.

Couldn't find even there in 1.0 M1 equivalents to e.g. spray's
HttpServiceBase.runRoute so at least temporarily I had to revert back from
akka-http to spray.

Kind regards,
Stevo Slavic.

On Wed, Dec 10, 2014 at 2:54 PM, Björn Antonsson <
bjorn.antons...@typesafe.com> wrote:

> Hi Stevo,
>
> There is no direct equivalent to the spray.routing.HttpService. The
> closest is probably the akka.http.server.japi.HttpService and
> akka.http.server.japi.HttpApp.
>
> B/
>
> On 9 December 2014 at 16:04:57, Stevo Slavić (ssla...@gmail.com) wrote:
>
>  Hello Akka community,
>
> In akka-http, is there an equivalent to spray.routing.HttpService?
>
> Kind regards,
> Stevo Slavic.
> --
> >> 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.
>
>
> --
> Björn Antonsson
> Typesafe  – Reactive Apps on the JVM
> twitter: @bantonsson 
>
>  --
> >> 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.
>

-- 
>>  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] akka-http HttpService equivalent

2015-01-04 Thread Jacek Laskowski
Hi,

Thanks for the hint, Björn. I've been pursuing the idea and used 
japi.HttpApp, but ended up with the following compilation error:

[error]  found   : akka.http.server.scala.Route
[error] (which expands to)  akka.http.server.RequestContext => scala.
concurrent.Future[akka.http.server.RouteResult]
[error]  required: akka.http.server.japi.Route


Before going any further, I'd love figuring out what's the intent of the 
japi package and how the seemingly alike types - scala.Route and japi.Route 
- compare. Where should they be used?

Jacek

On Wednesday, December 10, 2014 2:54:16 PM UTC+1, Björn Antonsson wrote:
>
> Hi Stevo,
>
> There is no direct equivalent to the spray.routing.HttpService. The 
> closest is probably the akka.http.server.japi.HttpService and 
> akka.http.server.japi.HttpApp.
>
> B/
>
> On 9 December 2014 at 16:04:57, Stevo Slavić (ssl...@gmail.com 
> ) wrote:
>
>  Hello Akka community,
>
> In akka-http, is there an equivalent to spray.routing.HttpService?
>
> Kind regards,
> Stevo Slavic.
> --
> >> 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 .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Björn Antonsson
> Typesafe  – Reactive Apps on the JVM
> twitter: @bantonsson 
>
>

-- 
>>  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] akka-http HttpService equivalent

2015-01-04 Thread Jacek Laskowski
Hi,

It appears to be "first step of Java routing API" [1] with just a single 
commit (perhaps squashed earlier to make it look so). What's Java routing 
API? How is this different from Scala's one if any?

[1] 
https://github.com/akka/akka/commits/release-2.3-dev/akka-http-java/src/main/scala/akka/http/server/japi/HttpApp.scala

Jacek

On Sunday, January 4, 2015 1:34:56 PM UTC+1, Jacek Laskowski wrote:
>
> Hi,
>
> Thanks for the hint, Björn. I've been pursuing the idea and used 
> japi.HttpApp, but ended up with the following compilation error:
>
> [error]  found   : akka.http.server.scala.Route
> [error] (which expands to)  akka.http.server.RequestContext => scala.
> concurrent.Future[akka.http.server.RouteResult]
> [error]  required: akka.http.server.japi.Route
>
>
> Before going any further, I'd love figuring out what's the intent of the 
> japi package and how the seemingly alike types - scala.Route and japi.Route 
> - compare. Where should they be used?
>
> Jacek
>
> On Wednesday, December 10, 2014 2:54:16 PM UTC+1, Björn Antonsson wrote:
>>
>> Hi Stevo,
>>
>> There is no direct equivalent to the spray.routing.HttpService. The 
>> closest is probably the akka.http.server.japi.HttpService and 
>> akka.http.server.japi.HttpApp.
>>
>> B/
>>
>> On 9 December 2014 at 16:04:57, Stevo Slavić (ssl...@gmail.com) wrote:
>>
>>  Hello Akka community,
>>
>> In akka-http, is there an equivalent to spray.routing.HttpService?
>>
>> Kind regards,
>> Stevo Slavic.
>> --
>> >> 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.
>> To post to this group, send email to akka...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> Björn Antonsson
>> Typesafe  – Reactive Apps on the JVM
>> twitter: @bantonsson 
>>
>>

-- 
>>  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] akka-http HttpService equivalent

2015-01-04 Thread Konrad 'ktoso' Malawski
Hi Jacek,
As the name implies, japi is the java api, you’re not meant to be using those 
if you’re using Scala - just use the normal scala APIs.
The Scala Routing DSL cannot be reused directly by Java since it’s using all 
kinds of Scala types which simlpy do not look as nice in Java.
Akka HTTP (and Akka in general) aims to provide both languages with equally 
awesome DSLs, thus if things do not look great in Java, they
may require a separate DSL which in turn can Java-native types everywhere etc. 
to make it feel “right” for a Java developer.

For example Akka Streams also has two separate DSLs. This is in order to 
maximise the user’s happieness when working with it from either Java or Scala,
we simply can apply “what a Scala/Java developer would expect here” and provide 
the best possible DSL for each.

The Java Routing DSL is in the works, some tests are here: 
https://github.com/akka/akka/blob/release-2.3-dev/akka-http-java8-tests/src/test/java/akka/http/server/japi/HandlerBindingTest.java
It’s looks a bit different than the Scala one, which is because Java is not 
Scala and we’re unable to apply all the tricks we can apply in Scala Land for 
the Java DSL.

Please note that this is a major improvement over spray, since it never had a 
Java DSL – with Akka HTTP even Java users will be able to use it :-)

Cheers,

-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe
http://akka.io

On 4 January 2015 at 14:08:16, Jacek Laskowski (jacek.japila...@gmail.com) 
wrote:

Hi,

It appears to be "first step of Java routing API" [1] with just a single commit 
(perhaps squashed earlier to make it look so). What's Java routing API? How is 
this different from Scala's one if any?

[1] 
https://github.com/akka/akka/commits/release-2.3-dev/akka-http-java/src/main/scala/akka/http/server/japi/HttpApp.scala

Jacek

On Sunday, January 4, 2015 1:34:56 PM UTC+1, Jacek Laskowski wrote:
Hi,

Thanks for the hint, Björn. I've been pursuing the idea and used japi.HttpApp, 
but ended up with the following compilation error:

[error]  found   : akka.http.server.scala.Route
[error]     (which expands to)  akka.http.server.RequestContext => 
scala.concurrent.Future[akka.http.server.RouteResult]
[error]  required: akka.http.server.japi.Route


Before going any further, I'd love figuring out what's the intent of the japi 
package and how the seemingly alike types - scala.Route and japi.Route - 
compare. Where should they be used?

Jacek

On Wednesday, December 10, 2014 2:54:16 PM UTC+1, Björn Antonsson wrote:
Hi Stevo,

There is no direct equivalent to the spray.routing.HttpService. The closest is 
probably the akka.http.server.japi.HttpService and 
akka.http.server.japi.HttpApp.

B/

On 9 December 2014 at 16:04:57, Stevo Slavić (ssl...@gmail.com) wrote:

Hello Akka community,

In akka-http, is there an equivalent to spray.routing.HttpService?

Kind regards,
Stevo Slavic.
--
>> 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.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

--
>> 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.

-- 
>>  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] akka-http HttpService equivalent

2015-01-05 Thread Jacek Laskowski
Thanks, Konrad! That's helped a lot.

Jacek

On Sunday, January 4, 2015 4:58:29 PM UTC+1, Konrad Malawski wrote:
>
> Hi Jacek,
> As the name implies, japi is the *java api*, you’re not meant to be using 
> those if you’re using Scala - just use the normal scala APIs.
> The Scala Routing DSL cannot be reused directly by Java since it’s using 
> all kinds of Scala types which simlpy do not look as nice in Java.
> Akka HTTP (and Akka in general) aims to provide both languages with 
> equally awesome DSLs, thus if things do not look great in Java, they
> may require a separate DSL which in turn can Java-native types everywhere 
> etc. to make it feel “*right*” for a Java developer.
>
> For example Akka Streams also has two separate DSLs. This is in order to 
> maximise the user’s happieness when working with it from either Java or 
> Scala,
> we simply can apply “what a Scala/Java developer would expect here” and 
> provide the best possible DSL for each.
>
> The Java Routing DSL is in the works, some tests are here: 
> https://github.com/akka/akka/blob/release-2.3-dev/akka-http-java8-tests/src/test/java/akka/http/server/japi/HandlerBindingTest.java
> It’s looks a bit different than the Scala one, which is because Java is 
> not Scala and we’re unable to apply all the tricks we can apply in Scala 
> Land for the Java DSL.
>
> Please note that this is a major improvement over spray, since it never 
> had a Java DSL – with Akka HTTP even Java users will be able to use it :-)
>
> Cheers,
>
> -- 
> Konrad 'ktoso' Malawski
> hAkker @ typesafe
> http://akka.io
>
> On 4 January 2015 at 14:08:16, Jacek Laskowski (jacek.j...@gmail.com 
> ) wrote:
>  Hi, 
>
> It appears to be "first step of Java routing API" [1] with just a single 
> commit (perhaps squashed earlier to make it look so). What's Java routing 
> API? How is this different from Scala's one if any?
>
>  [1] 
> https://github.com/akka/akka/commits/release-2.3-dev/akka-http-java/src/main/scala/akka/http/server/japi/HttpApp.scala
>
> Jacek
>
> On Sunday, January 4, 2015 1:34:56 PM UTC+1, Jacek Laskowski wrote: 
>>
>> Hi, 
>>
>> Thanks for the hint, Björn. I've been pursuing the idea and used 
>> japi.HttpApp, but ended up with the following compilation error:
>>
>>  [error]  found   : akka.http.server.scala.Route
>> [error] (which expands to)  akka.http.server.RequestContext => scala.
>> concurrent.Future[akka.http.server.RouteResult]
>> [error]  required: akka.http.server.japi.Route
>>
>>  
>> Before going any further, I'd love figuring out what's the intent of the 
>> japi package and how the seemingly alike types - scala.Route and japi.Route 
>> - compare. Where should they be used?
>>  
>> Jacek
>>
>> On Wednesday, December 10, 2014 2:54:16 PM UTC+1, Björn Antonsson wrote: 
>>>
>>>  Hi Stevo,
>>>  
>>>  There is no direct equivalent to the spray.routing.HttpService. The 
>>> closest is probably the akka.http.server.japi.HttpService and 
>>> akka.http.server.japi.HttpApp.
>>>  
>>>  B/
>>>  
>>> On 9 December 2014 at 16:04:57, Stevo Slavić (ssl...@gmail.com) wrote:
>>>
>>>   Hello Akka community,
>>>
>>> In akka-http, is there an equivalent to spray.routing.HttpService?
>>>
>>> Kind regards,
>>> Stevo Slavic.
>>> --
>>> >> 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.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>  
>>>   
>>> -- 
>>> Björn Antonsson
>>>  Typesafe  – Reactive Apps on the JVM
>>>  twitter: @bantonsson 
>>>
>>>  --
> >> 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 .
> To post to this group, send email to akka...@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 subsc