I started to fix akka-camel errors after the 2.0 upgrade. Here's a
status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a
separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a
look at the new akka-cluster stuff but goal is that consumer and
producer actors can be clustered as well.
Anything I forgot?
Cheers,
Martin
--
Martin Krasser
blog: http://krasserm.blogspot.com
code: http://github.com/krasserm
twitter: http://twitter.com/mrt1nz
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Cheers,
Martin
--
Martin Krasser
blog: http://krasserm.blogspot.com
code: http://github.com/krasserm
twitter: http://twitter.com/mrt1nz
On Mon, May 23, 2011 at 12:15 PM, Martin Krasser <kras...@googlemail.com> wrote:
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Please give me feedback on the TypedActor stuff when you get to that, if there's something missing we can get that sorted.
On Mon, May 23, 2011 at 12:15 PM, Martin Krasser <kras...@googlemail.com> wrote:
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Please give me feedback on the TypedActor stuff when you get to that, if there's something missing we can get that sorted.
Am 23.05.11 13:16, schrieb √iktor Ҡlang:
On Mon, May 23, 2011 at 12:15 PM, Martin Krasser <kras...@googlemail.com> wrote:
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Please give me feedback on the TypedActor stuff when you get to that, if there's something missing we can get that sorted.
After some initial experiments to get akka-camel-typed working, I found that method/param annotations on the interface-class are not visible through the proxy object via reflection. (The methods themselves are visible, of course). This prevents
- the current akka-camel-typed code from processing @consume annotations
- Camel from processing bean-binding annotations such as @Header, @Body etc.
With the former AspectWerkz proxies, annotations were visible. I didn't have time so far to make further investigations here (and can only do that next week).
On Tue, May 24, 2011 at 7:23 AM, Martin Krasser <kras...@googlemail.com> wrote:
Am 23.05.11 13:16, schrieb √iktor Ҡlang:
On Mon, May 23, 2011 at 12:15 PM, Martin Krasser <kras...@googlemail.com> wrote:
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Please give me feedback on the TypedActor stuff when you get to that, if there's something missing we can get that sorted.
After some initial experiments to get akka-camel-typed working, I found that method/param annotations on the interface-class are not visible through the proxy object via reflection. (The methods themselves are visible, of course). This prevents
- the current akka-camel-typed code from processing @consume annotations
- Camel from processing bean-binding annotations such as @Header, @Body etc.
With the former AspectWerkz proxies, annotations were visible. I didn't have time so far to make further investigations here (and can only do that next week).
Crap. Crap. Crap. Crap.
Annotations are the Devil™
Dynamic Proxy doesn't preserve the full signature of the class? I am shocked and saddened.
I want us to try to solve this without going back to loadtime/runtime weaving.
Any ideas?
2011/5/24 √iktor Ҡlang <viktor...@gmail.com>On Tue, May 24, 2011 at 7:23 AM, Martin Krasser <kras...@googlemail.com> wrote:
Am 23.05.11 13:16, schrieb √iktor Ҡlang:
On Mon, May 23, 2011 at 12:15 PM, Martin Krasser <kras...@googlemail.com> wrote:
Hi,
I started to fix akka-camel errors after the 2.0 upgrade. Here's a status update:
DONE: fixed compile errors and failing tests in akka-camel
TODO: rename id to address in Camel 'actor' component
TODO: update akka-camel-typed to new typed actor impl
TODO: merge akka-camel-typed back into akka-camel (no need to have a separate module any more after re-impl of typed actor)
TODO: check if akka-camel is 'cluster-friendly'. I still need to take a look at the new akka-cluster stuff but goal is that consumer and producer actors can be clustered as well.
Anything I forgot?
Please give me feedback on the TypedActor stuff when you get to that, if there's something missing we can get that sorted.
After some initial experiments to get akka-camel-typed working, I found that method/param annotations on the interface-class are not visible through the proxy object via reflection. (The methods themselves are visible, of course). This prevents
- the current akka-camel-typed code from processing @consume annotations
- Camel from processing bean-binding annotations such as @Header, @Body etc.
With the former AspectWerkz proxies, annotations were visible. I didn't have time so far to make further investigations here (and can only do that next week).
Crap. Crap. Crap. Crap.
Annotations are the Devil™
Dynamic Proxy doesn't preserve the full signature of the class? I am shocked and saddened.
I want us to try to solve this without going back to loadtime/runtime weaving.
Any ideas?
Would it help at all if I could provide a way to get at either the impl or the classes used for the interface, so you can pull the annotations from there?
your proposal would solve the problem of processing the
akka-camel-specific @consume annotation. But in order for Camel to
process the (Camel-specific) @Header or @Body annotations, one would
need to use that specific mechanism within Camel as well, which is not
an option. Furthermore, other frameworks (that could be potentially used
by typed-actor apps) also rely on the standard Class.getAnnotations or
Class.getDeclaredAnnotations methods for annotation processing.
Sorry for only saying 'no' at the moment, without offering a solution.
Need to think more about it.
Am 24.05.11 11:59, schrieb √iktor Ҡlang:
--
Hi Viktor,
your proposal would solve the problem of processing the akka-camel-specific @consume annotation. But in order for Camel to process the (Camel-specific) @Header or @Body annotations, one would need to use that specific mechanism within Camel as well, which is not an option. Furthermore, other frameworks (that could be potentially used by typed-actor apps) also rely on the standard Class.getAnnotations or Class.getDeclaredAnnotations methods for annotation processing.
Sorry for only saying 'no' at the moment, without offering a solution. Need to think more about it.
By the way Martin,
val a = TypedActor....
a.getClass.getInterfaces.toList.flatMap(annotationsFor)
res0: List[java.lang.annotation.Annotation] = List(@akka.actor.TestAnnotation(someString=pigdog))
So any annotations defined on the interfaces should be present on the proxies' interfaces.
It's just the a.getClass.getAnnotations etc that fail.
Don't camel/spring etc looks for the methods defined by the interfaces?
Am 24.05.11 15:05, schrieb √iktor Ҡlang:Yeah, but this is what worked with the AspectWerkz proxy. It seems that AspectWerkz is so friendly to inherit the annotations from the interface and I simply assumed that the JDK proxy works like the AspectWerkz proxy (note to myself: RTFM).By the way Martin,
val a = TypedActor....
a.getClass.getInterfaces.toList.flatMap(annotationsFor)
res0: List[java.lang.annotation.Annotation] = List(@akka.actor.TestAnnotation(someString=pigdog))
So any annotations defined on the interfaces should be present on the proxies' interfaces.
It's just the a.getClass.getAnnotations etc that fail.
Don't know yet. Will take a closer look as soon as I can. Ideally, this is really just a Camel issue, then I can fix it there.
Don't camel/spring etc looks for the methods defined by the interfaces?
One problem remains: the @Body and @Header annotations cannot be placed on the impl class, only the @consumer annotation (using some special processing in akka-camel) - I think that's a limitation one can easily live with (?)
On Tue, May 24, 2011 at 9:14 PM, Martin Krasser <kras...@googlemail.com> wrote:
Am 24.05.11 15:05, schrieb √iktor Ҡlang:Yeah, but this is what worked with the AspectWerkz proxy. It seems that AspectWerkz is so friendly to inherit the annotations from the interface and I simply assumed that the JDK proxy works like the AspectWerkz proxy (note to myself: RTFM).By the way Martin,
val a = TypedActor....
a.getClass.getInterfaces.toList.flatMap(annotationsFor)
res0: List[java.lang.annotation.Annotation] = List(@akka.actor.TestAnnotation(someString=pigdog))
So any annotations defined on the interfaces should be present on the proxies' interfaces.
It's just the a.getClass.getAnnotations etc that fail.
I was quite surprised myself.
Don't know yet. Will take a closer look as soon as I can. Ideally, this is really just a Camel issue, then I can fix it there.
Don't camel/spring etc looks for the methods defined by the interfaces?
That'd be great. JDK Proxies seem to suck arse...
One problem remains: the @Body and @Header annotations cannot be placed on the impl class, only the @consumer annotation (using some special processing in akka-camel) - I think that's a limitation one can easily live with (?)
What happens if you put the @Body etc on the interface?
Would be an easy, non-breaking change to do:
if (Proxy.isProxyInstance(x)) introspect(x.getClass.getInterfaces) else introspect(x.getClass)
Would be an easy, non-breaking change to do:
if (Proxy.isProxyInstance(x)) introspect(x.getClass.getInterfaces) else introspect(x.getClass)
Would be an easy, non-breaking change to do:
akka-camel-typed now works with the new typed actor implementation. I pushed my changes to branch 911-krasserm, commit https://github.com/jboner/akka/commit/efd9a895e87a445377e4547841001d1237b29083
1.) I needed to introduce some small changes to ActorRegistry.scala and TypedActor.scala:
- ActorRegistered and ActorUnregistered now also contain an optional typed actor reference. For a typed actor registration/unregistration it is Some(typedActor) otherwise None. This was needed because a typed actor lookup in the actor registry after receiving an ActorUnregistered event wasn't possible (and akka-camel-typed needs access to the typed actor after unregistration). Although this problem doesn't come up with ActorRegistered events, I extended this case class as well for reasons of symmetry.
- Registration logic of TypedActor.TypedActor was moved to ActorRegistry.registerTypedActor (better encapsulation)
2.) https://issues.apache.org/jira/browse/CAMEL-4040 is now fixed in Camel 2.8. Until it is released we'll use a patched camel-core-2.7.1.1 which has already been uploaded to the Akka Maven repo (thanks to Peter Vlugter).
On Mon, Jun 6, 2011 at 2:59 AM, Martin Krasser <kras...@googlemail.com> wrote:
akka-camel-typed now works with the new typed actor implementation. I pushed my changes to branch 911-krasserm, commit https://github.com/jboner/akka/commit/efd9a895e87a445377e4547841001d1237b29083
1.) I needed to introduce some small changes to ActorRegistry.scala and TypedActor.scala:
- ActorRegistered and ActorUnregistered now also contain an optional typed actor reference. For a typed actor registration/unregistration it is Some(typedActor) otherwise None. This was needed because a typed actor lookup in the actor registry after receiving an ActorUnregistered event wasn't possible (and akka-camel-typed needs access to the typed actor after unregistration). Although this problem doesn't come up with ActorRegistered events, I extended this case class as well for reasons of symmetry.
- Registration logic of TypedActor.TypedActor was moved to ActorRegistry.registerTypedActor (better encapsulation)
Otherwise it's pretty easy to get the handle for a typed actor from an actorref: Actor.registry.typedActorFor(reference)
Am 06.06.11 16:31, schrieb √iktor Ҡlang:This is what I initially did. The only case where it doesn't work is after receiving an ActorUnregistered event (because then the handle is already removed from the registry).
On Mon, Jun 6, 2011 at 2:59 AM, Martin Krasser <kras...@googlemail.com> wrote:
akka-camel-typed now works with the new typed actor implementation. I pushed my changes to branch 911-krasserm, commit https://github.com/jboner/akka/commit/efd9a895e87a445377e4547841001d1237b29083
1.) I needed to introduce some small changes to ActorRegistry.scala and TypedActor.scala:
- ActorRegistered and ActorUnregistered now also contain an optional typed actor reference. For a typed actor registration/unregistration it is Some(typedActor) otherwise None. This was needed because a typed actor lookup in the actor registry after receiving an ActorUnregistered event wasn't possible (and akka-camel-typed needs access to the typed actor after unregistration). Although this problem doesn't come up with ActorRegistered events, I extended this case class as well for reasons of symmetry.
- Registration logic of TypedActor.TypedActor was moved to ActorRegistry.registerTypedActor (better encapsulation)
Otherwise it's pretty easy to get the handle for a typed actor from an actorref: Actor.registry.typedActorFor(reference)