lagom 1.3 missing MessageSerializer for play.api.mvc.Result

75 views
Skip to first unread message

guy.y...@googlemail.com

unread,
Nov 19, 2017, 2:27:06 PM11/19/17
to Lagom Framework Users
Hey Guys,

I am working on a service for uploading file and I am using Lagom 1.3.x and specially the Play Framework.
I have a MessageSerializer compile problems with com.lightbend.lagom.scaladsl.api.ServiceCall and not with
com.lightbend.lagom.javadsl.api.ServiceCall. The Java implementation of the service compiles without failures and use com.lightbend.lagom.javadsl.server.PlayServiceCall.

Here is just the signature of one method of the service api:
1- Scala version - def uploadMedia(id: String): ServiceCall[NotUsed, play.api.mvc.Result]
2- Java version - ServiceCall<NotUsed, play.api.mvc.Result> uploadMedia(id: String)

The following is the compiler error concerning the missing MessageSerializer for play.api.mvc.Result:
[error] xxxx/media-service-scala-api/src/main/scala/com/ndolo/media/service/MediaService.scala:19: could not find implicit value for parameter responseSerializer: com.lightbend.lagom.scaladsl.api.deser.MessageSerializer[play.api.mvc.Result, _]
[error]       Service.restCall(Method.POST, "/service/media/users/:uploadMedia/upload", uploadMedia _),
[error]                       ^
[error] one error found

Do I miss something? Please I would be glad to have support concerning this issue.


Best,

Guy

Tim Moore

unread,
Nov 29, 2017, 5:20:43 AM11/29/17
to guy.y...@googlemail.com, Lagom Framework Users
Hi Guy,

Lagom does not use the Play Result class natively. The expectation is that you will use a domain-specific type that supports serialization to some common format.

You can use akka.Done if you don't have any information you need to send in the response.

Best,
Tim

--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framework+unsubscribe@googlegroups.com.
To post to this group, send email to lagom-framework@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/cbe7c9e3-b9b1-44df-8b62-681f6d354a84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tim Moore
Senior Engineer, Lagom, Lightbend, Inc.

guy.y...@googlemail.com

unread,
Dec 4, 2017, 3:48:50 PM12/4/17
to Lagom Framework Users
Hi Tim,

thanks for your answer concerning the issue.
But actually I need to send some information in the response. So I am investigating how to transform a PlayServiceCall<Request, Response> to a ServiceCall<Request, Response> to get rid rid from PlayServiceCall<Request, Response>.
interface PlayServiceCall<Request, Response> {
       
 
EssentialAction invoke(Function<ServiceCall<Request, Response>, EssentialAction> wrapCall);
}

is there a good way to do this? Help would be appreciated

Guy


Am Mittwoch, 29. November 2017 11:20:43 UTC+1 schrieb Tim Moore:
Hi Guy,

Lagom does not use the Play Result class natively. The expectation is that you will use a domain-specific type that supports serialization to some common format.

You can use akka.Done if you don't have any information you need to send in the response.

Best,
Tim
On Mon, Nov 20, 2017 at 5:57 AM, guy.youansi via Lagom Framework Users <lagom-f...@googlegroups.com> wrote:
Hey Guys,

I am working on a service for uploading file and I am using Lagom 1.3.x and specially the Play Framework.
I have a MessageSerializer compile problems with com.lightbend.lagom.scaladsl.api.ServiceCall and not with
com.lightbend.lagom.javadsl.api.ServiceCall. The Java implementation of the service compiles without failures and use com.lightbend.lagom.javadsl.server.PlayServiceCall.

Here is just the signature of one method of the service api:
1- Scala version - def uploadMedia(id: String): ServiceCall[NotUsed, play.api.mvc.Result]
2- Java version - ServiceCall<NotUsed, play.api.mvc.Result> uploadMedia(id: String)

The following is the compiler error concerning the missing MessageSerializer for play.api.mvc.Result:
[error] xxxx/media-service-scala-api/src/main/scala/com/ndolo/media/service/MediaService.scala:19: could not find implicit value for parameter responseSerializer: com.lightbend.lagom.scaladsl.api.deser.MessageSerializer[play.api.mvc.Result, _]
[error]       Service.restCall(Method.POST, "/service/media/users/:uploadMedia/upload", uploadMedia _),
[error]                       ^
[error] one error found

Do I miss something? Please I would be glad to have support concerning this issue.


Best,

Guy

--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framewo...@googlegroups.com.
To post to this group, send email to lagom-f...@googlegroups.com.

Tim Moore

unread,
Dec 11, 2017, 11:54:43 PM12/11/17
to guy.y...@googlemail.com, Lagom Framework Users
Hi Guy,

Could you be more specific about what you need to do? I don't totally understand what's wrong from the small amount of code provided. Can you share an example on GitHub?

Best,
Tim

To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framework+unsubscribe@googlegroups.com.
To post to this group, send email to lagom-framework@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/2eb802cc-09e2-4a2d-a9e7-a252a932bdde%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

guy.y...@googlemail.com

unread,
Dec 12, 2017, 12:23:38 PM12/12/17
to Lagom Framework Users
Hi Tim,

thanks a lot and I will try to share the code over gihub. I will let you know when I am done.

Best,

Guy

guy.y...@googlemail.com

unread,
Feb 25, 2018, 3:50:15 PM2/25/18
to Lagom Framework Users
Hi Tim,

sorry for taking long time concerning this issue. I was just to busy with other stuff.
Now I have a github project (https://github.com/ralphlaude/upload-service) and you can now better understand, what the issue is.

Thanks a lot for helping.

Best,

Guy


Am Dienstag, 12. Dezember 2017 05:54:43 UTC+1 schrieb Tim Moore:
Hi Guy,

Could you be more specific about what you need to do? I don't totally understand what's wrong from the small amount of code provided. Can you share an example on GitHub?

Best,
Tim

Tim Moore

unread,
Mar 6, 2018, 1:24:46 AM3/6/18
to guy.y...@googlemail.com, Lagom Framework Users
Guy,

You might be interested in the new file upload recipe: https://github.com/lagom/lagom-recipes/tree/master/file-upload/file-upload-scala-sbt

This shows a different approach for handling files using an ordinary Play controller, and demonstrates composing Play routes with a Lagom service in the same application.

I hope that makes things simpler. We look forward to hearing your feedback.

Best,
Tim


For more options, visit https://groups.google.com/d/optout.



--
Tim Moore
Lagom Tech Lead, Lightbend, Inc.

guy.y...@googlemail.com

unread,
Mar 6, 2018, 3:01:57 PM3/6/18
to Lagom Framework Users
Hi Tim,

Thanks a lot.
I will take a look at the recipe and perhaps I will come back to you.

Best,

Guy


Am Dienstag, 6. März 2018 07:24:46 UTC+1 schrieb Tim Moore:
Guy,

You might be interested in the new file upload recipe: https://github.com/lagom/lagom-recipes/tree/master/file-upload/file-upload-scala-sbt

This shows a different approach for handling files using an ordinary Play controller, and demonstrates composing Play routes with a Lagom service in the same application.

I hope that makes things simpler. We look forward to hearing your feedback.

Best,
Tim
On Mon, Feb 26, 2018 at 7:20 AM, guy.youansi via Lagom Framework Users <lagom-f...@googlegroups.com> wrote:
Hi Tim,

sorry for taking long time concerning this issue. I was just to busy with other stuff.
Now I have a github project (https://github.com/ralphlaude/upload-service) and you can now better understand, what the issue is.

Thanks a lot for helping.

Best,

Guy


Am Dienstag, 12. Dezember 2017 05:54:43 UTC+1 schrieb Tim Moore:
Hi Guy,

Could you be more specific about what you need to do? I don't totally understand what's wrong from the small amount of code provided. Can you share an example on GitHub?

Best,
Tim



--
Tim Moore
Senior Engineer, Lagom, Lightbend, Inc.

--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framewo...@googlegroups.com.
To post to this group, send email to lagom-f...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages