Re: [akka-user] Event Adapters and custom journals

2016-08-14 Thread Patrik Nordwall
On Wed, Aug 10, 2016 at 1:13 PM, Daniel Stoner 
wrote:

> Hi all,
>
> Having read the docs on EventAdapters (http://doc.akka.io/docs/akka/
> 2.4.9-RC2/java/persistence.html#event-adapters-java) and seeing the
> example of how to ignore particular classes I thought this would be a
> perfect solution for me.
>
> Having implemented the example I have tried to the following the
> application.conf example where event-adapter is defined inside the
> 'journal.inmem' config location (EG The location specified by
> journal.plugin value). As such I have:
>
> persistence {
> journal {
> plugin = "com.osp.scs.libnado.persistence.dynamodb"
> }
> ..more things
> }
>
> com.osp.scs.libnado.persistence.dynamodb {
> event-adapters {
> class-not-found = "com.osp.scs.libnado.akka.codec.
> ClassNotFoundEventAdapter"
>   }
>   event-adapter-bindings {
> "com.osp.scs.libnado.akka.codec.JacksonSerializable" =
> class-not-found
>   }
> }
>
> Now it has suddenly occurred to me (since this isn't working) that
> actually event adaptation is something that has to be implemented in each
> Journal implementation that exists and not something that Akka is providing
> before it gets to the journal itself.
>
> Is this the case or am I just putting my config in the wrong place?
> If the former the documentation on how to write your own custom Journal
> may need updating to reflect the intended requirement to support this
> feature.
>

That is true. The TCK should also cover it. Please create an issue, and a
pull request would be great.


>
> Further - are there any shortcuts for implementing the requirements such
> as there is with Serialization and the serialisation-bindings and other
> assorted config working. EG You just utilise SerializationExtension.get(
> system).serialize(entity).
>

Persistence.get(system).adaptersFor


>
> Thanks kindly,
> Daniel Stoner
> --
> Daniel Stoner | Senior Software Engineer UtopiaIT | Ocado Technology
> daniel.sto...@ocado.com | Ext 7969 | www.ocadotechnology.com
>
>
> Notice:  This email is confidential and may contain copyright material of
> members of the Ocado Group. Opinions and views expressed in this message
> may not necessarily reflect the opinions and views of the members of the
> Ocado Group.
>
>
>
> If you are not the intended recipient, please notify us immediately and
> delete all copies of this message. Please note that it is your
> responsibility to scan this message for viruses.
>
>
>
> Fetch and Sizzle are trading names of Speciality Stores Limited and Fabled
> is a trading name of Marie Claire Beauty Limited, both members of the Ocado
> Group.
>
>
>
> References to the “Ocado Group” are to Ocado Group plc (registered in
> England and Wales with number 7098618) and its subsidiary undertakings (as
> that expression is defined in the Companies Act 2006) from time to time.
> The registered office of Ocado Group plc is Titan Court, 3 Bishops Square,
> Hatfield Business Park, Hatfield, Herts. AL10 9NE.
>
> --
> >> 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 https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend  -  Reactive apps on the JVM
Twitter: @patriknw

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


Re: [akka-user] Akka Actor

2016-08-14 Thread Kenji Kobayashi
Sure I did have a Progress Message via the main actor which call to the 
workerActor to return current progress, but the user is able to call the 
endpoint over and over again, that meaning I need some indicator whether 
the actor has finished or still running.

More or less like this schema..

User1 -> End Point -> Main Actor fires tasks to workers (mainActor ? 
startProcess)

User2 -> End Point -> Main Actor fires tasks to workers if not already 
started... etc...

I recently thought of using future.onCompleted, so as long if the 
future.onCompleted returns false that shows the progress is still running 
but somehow it won't work that way

On Friday, August 12, 2016 at 7:20:22 PM UTC+7, Justin du coeur wrote:
>
> Sure, but there's nothing built in -- you'd have to roll something 
> yourself.
>
> The most obvious way to do it is to add a Progress message, which the 
> outside system strobes to mainActor, say, once a second, and which 
> mainActor responds with the current state of the processing.  (I do a much 
> more involved version of this for my UIs, when they are doing long 
> operations that may take tens or hundreds of seconds, so I can show a 
> progress bar.)
>
> But there are lots of ways to slice this problem -- the right one will 
> depend on your specific problem and environment...
>
> On Fri, Aug 12, 2016 at 6:36 AM, Kenji Kobayashi  > wrote:
>
>> Currently I have rest-endpoint-api-playframework that contains main actor 
>> to run n number of worker-actors doing batch-insertion. while in the 
>> process of doing that, I'd love to get current process of the inserts, lets 
>> say 100/1000. in order to do that, obviously I'll have the actor to report 
>> to the sender what is the status of the process.
>>
>> class Application (implicit inj : Injector) extends Controller with 
>> Injectable {
>>   implicit val timeout = Timeout(5 seconds)
>>   val mainActor = system.actorOf(RoundRobinPool(100).props(Props(new 
>> SupervisorActor(0))), name = "helloactor")
>>
>>   val future = mainActor ? ProcessBatch  
>>
>>   val workerFuture = mainActor ? CurrentProcessedItem
>>   result = Await.result(workerFuture, timeout.duration).asInstanceOf[String] 
>>
>>   Ok(Json.obj("return"->result.toString))  }
>>
>> above, I'd expect that if helloActor ? ProcessBatch has completed, then 
>> I'd just return the process is completed, otherwise I'd run the mainActor 
>> ? CurrentProcessedItem that returns a future of the currentProcessedItem.
>>
>> So basically I will need an indicator whether mainActor ? ProcessBatch has 
>> completed or not. is it possible?
>>
>> -- 
>> >> 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 https://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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Access Denied Downloading standalone akka_2.11-2.4.9-RC2.zip

2016-08-14 Thread murtuza chhil
Hello, 

Get an error  downloading  latest standalone release from page 
http://akka.io/downloads/

The zip downlod link is 
http://downloads.typesafe.com/akka/akka_2.11-2.4.9-RC2.zip?_ga=1.68079190.614045507.1468130713

Error page Content

AccessDeniedAccess 
Denied4E93081229D790D5hTqKBgBzP1ydnHywim1E/9e/YrVnhfWyZQ+m39zdiIqoJMrd+VwOLyCBQ+pTw4DX5vByBmimSBs=

​

-chhil

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


[akka-user] What means of akka cluster roles leader?

2016-08-14 Thread Yutao Shuai




What this function means? Select a nodes with specfic roles as the cluster 
leader or every roles has its leader?

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


[akka-user] ConductR sandbox linking to another container

2016-08-14 Thread Chris Baxter
I don't know of any ConductR user group or forum out there, so I am asking 
here.  I am playing around with the ConductR sandbox on my Mac and I want 
to be able to have my 3 ConductR nodes communicate with Cassandra which is 
running in another local container.  Usually, this can be accomplished with 
links (--link) being established when starting up the containers.  But it 
seems that you cannot use the --link option when running the sandbox via 
"sandbox run ...".  I know you can deploy Cassandra as another bundle into 
ConductR but I don't want to go that route.  Does anyone have any expertise 
or suggestions on being able to setup a networking link between a ConductR 
node's container in sandbox and my Cassandra container?

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


[akka-user] Basic Akka stream server not receiving data sent by client

2016-08-14 Thread murtuza chhil
Hi,

I have a simple client that reads a csv file and send it across. When I 
have a netcat server I can see the data come through.

However when I have a Akka stream based server I do see the connection but 
I don't see the data come through. 

Could someone be kind enough to let me know where I have screwed up?

Server code 


ActorSystem system = ActorSystem.create("System");
ActorMaterializer mat = ActorMaterializer.create(system);

Source> serverSource 
= Tcp
.get(system).bind("127.0.0.1", 6000);
serverSource.runForeach(
conn -> {
System.out.println(conn.remoteAddress());
Sink receiveSink = conn
.flow()
.via(Framing.delimiter(
ByteString.fromString("\r\n"), 10))
.to(Sink.foreach(str -> {
System.out.println("< " + str);
// Thread.sleep(10);
}));
Source emptySource = Source.empty();
emptySource.to(receiveSink).run(mat);

}, mat);

​


Client code : Reads a file, prints it line by and sends it over the socket. 
The connecting and sending part works as I can see the data received at a 
netcat server.

ActorSystem system = ActorSystem.create("client");
ActorMaterializer mat = ActorMaterializer.create(system);

Flow> 
serverConnection = Tcp
.get(system).outgoingConnection("127.0.0.1", 6000);
Path file = Paths.get("C:\\temp\\Generic.csv");
CompletionStage cs = FileIO.fromPath(file)

.via(Framing.delimiter(ByteString.fromString("\r\n"), 10))
.map(str -> {
System.out.println(str.utf8String());
return str.concat(ByteString.fromString("\r\n"));
})

.via(serverConnection).to(akka.stream.javadsl.Sink.ignore())
.run(mat);

​
-chhil

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