[2.5 Java] Which mongo plugin?

375 προβολές
Παράβλεψη και μετάβαση στο πρώτο μη αναγνωσμένο μήνυμα

Enrico Morelli

μη αναγνωσμένη,
7 Μαρ 2016, 10:20:27 π.μ.7/3/16
ως play-framework
Until Play 2.5 I used jongo + play-jongo to use MongoDB. With 2.5 which is the plugin I've to use to connect to Mongo?

Greg Methvin

μη αναγνωσμένη,
7 Μαρ 2016, 1:01:57 μ.μ.7/3/16
ως play-framework
It seems like it only works for 2.4 but there is an open issue for it.

The migration for Play modules is not as much as it was in 2.4, so it should not be too difficult for library authors to update.

On Mon, Mar 7, 2016 at 7:20 AM, Enrico Morelli <enrico....@gmail.com> wrote:
Until Play 2.5 I used jongo + play-jongo to use MongoDB. With 2.5 which is the plugin I've to use to connect to Mongo?

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/cda0d599-022d-448f-bb20-390518677de8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Senior Software Engineer

Enrico Morelli

μη αναγνωσμένη,
8 Μαρ 2016, 4:23:11 π.μ.8/3/16
ως play-framework


On Monday, March 7, 2016 at 7:01:57 PM UTC+1, Greg Methvin wrote:
It seems like it only works for 2.4 but there is an open issue for it.

The migration for Play modules is not as much as it was in 2.4, so it should not be too difficult for library authors to update.



I opened the issue ;-)

Play! is a wonderful and modern framework, but I think should have an official  MongoDB plugin like the various SQL ORM linked in the documentation.

Greg Methvin

μη αναγνωσμένη,
9 Μαρ 2016, 8:11:46 μ.μ.9/3/16
ως play-framework
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

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

Igmar Palsenberg

μη αναγνωσμένη,
10 Μαρ 2016, 12:52:43 μ.μ.10/3/16
ως play-framework
 
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.

It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.


Igmar 

Will Sargent

μη αναγνωσμένη,
10 Μαρ 2016, 11:26:57 μ.μ.10/3/16
ως play-fr...@googlegroups.com
It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.

Igmar Palsenberg

μη αναγνωσμένη,
11 Μαρ 2016, 2:56:07 π.μ.11/3/16
ως play-framework
 
It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.


That's more targeted at old Play plugins to become DI modules. I'm talking about having an existing Java library, taking it apart, make it DI ready, and if applicable, also make it asynchronous.

That's quite hard, especially if you haven't done that a lot. At least, on the library I tried :-)


Igmar

Enrico Morelli

μη αναγνωσμένη,
11 Μαρ 2016, 8:22:05 π.μ.11/3/16
ως play-framework


On Thursday, March 10, 2016 at 2:11:46 AM UTC+1, Greg Methvin wrote:
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.



But what are  the differences between 2.4 and 2.5 modules? I tried a lot of 2.4 modules on 2.5 and the majority of them didn't works.
I have read the module documentation and, e.g., the JongoModule.java follow the specification but it's evicted by Play! 2.5.

So
there might  be some difference that is not included in the documentation?

Igmar Palsenberg

μη αναγνωσμένη,
11 Μαρ 2016, 8:52:03 π.μ.11/3/16
ως play-framework

But what are  the differences between 2.4 and 2.5 modules? I tried a lot of 2.4 modules on 2.5 and the majority of them didn't works.
I have read the module documentation and, e.g., the JongoModule.java follow the specification but it's evicted by Play! 2.5.

So
there might  be some difference that is not included in the documentation?

Modules don't exist anymore in 2.5. A "module" in 2.5 is just a bunch of classes that are bound in DI.


Igmar

Enrico Morelli

μη αναγνωσμένη,
11 Μαρ 2016, 9:04:13 π.μ.11/3/16
ως play-framework


Thanks for information, but then the documentation is incorrect because on https://playframework.com/documentation/2.5.x/JavaPlayModules I read: "in 2.5.x, Plugins have been replaced with Play modules.".

Please, my head is near to explode :-o , where I can find instruction to be able to use/create 2.5 libraries?

Igmar Palsenberg

μη αναγνωσμένη,
11 Μαρ 2016, 9:18:54 π.μ.11/3/16
ως play-framework
 
Thanks for information, but then the documentation is incorrect because on https://playframework.com/documentation/2.5.x/JavaPlayModules I read: "in 2.5.x, Plugins have been replaced with Play modules.".

The documentation is fine : Plugins are out, modules are in. A "module" is just classes bound in DI.


Igmar

Enrico Morelli

μη αναγνωσμένη,
11 Μαρ 2016, 10:24:05 π.μ.11/3/16
ως play-framework

Ok, I'm going crazy.  So in the 2.5 documentation the example is:

public class MyModule extends play.api.inject.Module {
   
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
       
return seq(
                bind
(MyApi.class).toSelf()
       
);
   
}
}


The JongoModule is the following:

public class JongoModule extends Module {

   
@Override
   
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
       
return seq(bind(PlayJongo.class).toSelf());
   
}
}

 
which may be the incompatibility? What other things I've to check?

raunak

μη αναγνωσμένη,
11 Μαρ 2016, 8:33:28 μ.μ.11/3/16
ως play-framework
I'm a bit confused. Is there an error you're getting Enrico whilst using PlayJongo?

Enrico Morelli

μη αναγνωσμένη,
14 Μαρ 2016, 4:38:15 π.μ.14/3/16
ως play-framework


On Saturday, March 12, 2016 at 2:33:28 AM UTC+1, raunak wrote:
I'm a bit confused. Is there an error you're getting Enrico whilst using PlayJongo?

Yes. The module is evicted by Play.

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]     * com.typesafe.play:play-netty-server_2.11:2.4.2 -> 2.5.0 (caller: docarchive:docarchive_2.11:1.0-SNAPSHOT, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2)
[warn]     * com.typesafe.play:play-java_2.11:2.4.2 -> 2.5.0 (caller: com.typesafe.play:filters-helpers_2.11:2.5.0, docarchive:docarchive_2.11:1.0-SNAPSHOT, com.typesafe.play:play-java-jdbc_2.11:2.5.0, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2, com.typesafe.play:play-java-ws_2.11:2.5.0)

If I remove PlayJongo from build.sbt all works fine.

Igmar Palsenberg

μη αναγνωσμένη,
14 Μαρ 2016, 5:47:36 π.μ.14/3/16
ως play-framework

Yes. The module is evicted by Play.

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]     * com.typesafe.play:play-netty-server_2.11:2.4.2 -> 2.5.0 (caller: docarchive:docarchive_2.11:1.0-SNAPSHOT, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2)
[warn]     * com.typesafe.play:play-java_2.11:2.4.2 -> 2.5.0 (caller: com.typesafe.play:filters-helpers_2.11:2.5.0, docarchive:docarchive_2.11:1.0-SNAPSHOT, com.typesafe.play:play-java-jdbc_2.11:2.5.0, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2, com.typesafe.play:play-java-ws_2.11:2.5.0)

If I remove PlayJongo from build.sbt all works fine.

Looks like it depends on Play 2.4, which isn't compatible with 2.5 on a binary level.  

Greg Methvin

μη αναγνωσμένη,
14 Μαρ 2016, 6:14:23 π.μ.14/3/16
ως play-framework
An eviction warning in sbt just tells you it is using the newer version of those libraries. It's quite possible everything works just fine if play-jongo doesn't happen to use any of the things that changed between the releases, though it would obviously be better if they built off Play 2.5 so you know for sure.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

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

Enrico Morelli

μη αναγνωσμένη,
14 Μαρ 2016, 6:26:25 π.μ.14/3/16
ως play-framework


You are ready. I recompiled using 2.5 libraries and it works fine.

Thanks
Απάντηση σε όλους
Απάντηση στον συντάκτη
Προώθηση
0 νέα μηνύματα