Some exceptions through using gatling+tcp extension

Hi, gatling Dev. Team!

I use gatling-tcp-extension as sbt plugin for sending tcp requests from here .
Now I have some exceptions during the simulations.

`

WARNING: EXCEPTION, please implement io.gatling.tcp.MessageListener.exceptionCaught() for proper handling.
java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:265)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:474)
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$UnpooledSendBuffer.transferTo(SocketSendBufferPool.java:203)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:201)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:151)
at org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:315)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

`

Also I have detected that disconnect function does not work from time to time and there are no fail requests in the report.

For example at the end of the simulations :
`

---- Requests ------------------------------------------------------------------

Global (OK=24 KO=0 )
connect (OK=4 KO=0 )
Say Hello Tcp (OK=17 KO=0 )
disconnect (OK=3 KO=0 )

`

This is my scenario:

`

import io.gatling.core.Predef._
import io.gatling.core.scenario.Simulation
import io.gatling.tcp.Predef._
import scala.concurrent.duration._

class TcpTest extends Simulation {

val tcpConfig = tcp.address(“127.0.0.1”).port(4800).lengthBased(4)

val scn = scenario(“Tcp”)
.exec(tcp(“Connect”).connect())
.repeat(5, “i”) {

exec(tcp(“Say Hello Tcp”)
.sendText(“${i}” + System.currentTimeMillis/1000)
)
}
.exec(tcp(“disconnect”).disconnect())

setUp(scn.inject(constantUsersPerSec(2) during(2 seconds))).maxDuration(5 seconds).protocols(tcpConfig)

}

`

How can I fix this exception and fix something wrong with disconnect function?

Thanks in advance,
Jetta

The problem was in uncorrect webserver.
Now it`s working
Thank you

Hi,

I have similar requirement, I need to test TCP connection code writtern in java with the help of spring integration. Now for performance testing i need to write gatling script. I am new to scala and gatling, please help to give any pointer for start.

Thanks,
Prabhjot