Are you OK getting connections and disconnections logged as INFO? Does
it bother you at all?
> --
> You received this message because you are subscribed to the Google Groups "Hazelcast" group.
> To post to this group, send email to haze...@googlegroups.com.
> To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
>
>
HTTP DELETE
http://member-ip:5701/hazelcast/rest/queues/myq/3
means
Hazelcast.getQueue("myq").poll(3, SECONDS);
I just did a quick performance test.. single thread putting 5000 items
and logging the time it takes.
You can find the code below. Just copy and run. It takes about 1500ms
to offer 5000 items. Here is the complete output on my laptop:
Took 4275
5000
Took 2535
5000
Took 2495
5000
Took 1397
5000
Took 1368
5000
Took 1471
5000
Took 1374
5000
Took 1512
5000
Took 1392
5000
Took 1378
5000
Took 1377
5000
Took 1381
5000
Took 1391
5000
Took 1398
5000
Took 1428
5000
-------------------------------------------------------------------
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.IQueue;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class HttpUtil {
public static void post(String httpURL, byte[] data) {
try {
URL url = new URL(httpURL);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
if (data != null) {
dos.write(data);
}
dos.flush();
BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// do nothing
}
dos.close();
rd.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
IQueue queue = Hazelcast.getQueue("default");
while (true) {
long start = System.currentTimeMillis();
for (int i = 0; i < 5000; i++) {
post("http://127.0.0.1:5701/hazelcast/rest/queues/default/item" + i,
null);
}
System.out.println("Took " + (System.currentTimeMillis() - start));
System.out.println(queue.size());
queue.clear();
}
}
}