Notification on Create Users

Hi,

I'm developing the TCPDataWriter and I'm with some doubts...
I've used the JdbcDataWriter as a model and when I init the test it throws
an exception saying the actor can't receive the Init message
java.lang.IllegalArgumentException: Actor TCPDataWriter doesn't support
message
Init(RunMessage(com.mv.NavigationSimulation,navigationsimulation,2014-03-26T18:09:04.683-03:00,navigationsimulation),List(ShortScenarioDescription(Ricardo
Eletro Users,1)))
Why the JdbcDataWriter goes fine and my class not?

When I finish, should I make a pull request? (if you want this in your
project) And how to do it (never did a pull request)

Best regards,

Hey,

What does your TCPDataWriter do exactly? What’s the format of the messages?

A gist would help.

If your component is generic and can be reused, why not. If I think we’ll have some kind of “extras” projet.

Cheers,

Stéphane

It opens a socket with a host and send the data through it. I’m testing with objectoutputstream but I’m thinking about json…

And do you know what can be causing this issue of the actor doesn’s supporting the Init message?

No.

My2cents: the problem is in your code. DataWriters have a lifecycle defined in the DataWriter class, it seems you’re note overriding the proper methods.

I’m doing the writer and I’m with a problem…
When I try to connect to a server to send the data and it fails, I terminate the DataWriter, but I need to connect after the intialization of the DataWriter because only after this, the DataWriter will accept Terminate messages. If I just ignore, the actor crashes and it creates an infinite loop trying to connect.
What I did:
I’ve created a lazy val to hold the connection actor and only when the first message arrives it will trigger the connect.

lazy val msgSender = actor(context)(new TCPMessageSender(context.self))

override def onRequestMessage(request: RequestMessage) = {
msgSender forward request
}

It works, but there’s a problem. Some messages are sent to the connection actor before it connects, so I have to dicard or buffer them.
I don’t want to do any of this approachs. Do you have any idea on how I can force the connect being triggered after the initialization of the DataWriter or how to solve this problem (or if a just discard or buffer the messages)?

Thanks

Have a look at the GraphiteDataWriter.