Hi,
we're currently encountering the same problem.
We would like to use UDP packets to send metric to a 3rd party system
(hostedgraphite).
Trying to send UDP with appengine succeed on test server/my console, but
fails once deployed to our servers.
Code:
log.info("building socket");
DatagramSocket socket = new DatagramSocket();
byte[] data = builder.toString().getBytes(Charsets.ISO_8859_1);
InetAddress address = InetAddress.getByName(host);
log.info("trying to send socket message to " +
address.getHostAddress());
DatagramPacket datagramPacket = new DatagramPacket(data,
data.length, address, port);
log.info("packet " +
datagramPacket.getSocketAddress().toString() + " " + new
String(datagramPacket.getData()));
socket.connect(address, port);
log.info("connected to" + address.getHostAddress() + "? " +
socket.isConnected());
socket.send(datagramPacket);
log.info("metric committed in " + new Interval(start, new
Instant()).toDurationMillis());
Note: I've added a socket.connect() just to test wether any connection
problem was found between app engine and this server.
Resulting logs:
I 2013-10-29 16:36:10.403 com.cb.util.metric.GaeMetric commit: building
socket
I 2013-10-29 16:36:10.767 com.cb.util.metric.GaeMetric commit: trying to
send socket message to 88.198.22.7
I 2013-10-29 16:36:10.769 com.cb.util.metric.GaeMetric commit: packet
carbon.hostedgraphite.com/88.198.22.7:2003 metric-one.timeTaken 7047
metric-two.timeTaken 499
I 2013-10-29 16:36:10.769 com.cb.util.metric.GaeMetric commit: connected to
88.198.22.7? true
W 2013-10-29 16:36:50.629 com.cb.util.metric.GaeMetric commit: failed to
commit metric in 40226 error:
com.google.apphosting.api.DeadlineExceededException: This request
(b07775a3893d6656) started at 2013/10/29 16:35:51.219 UTC and was still
executing at 2013/10/29 16:36:50.627 UTC.
Anything else I can provide to help you check where the issue is?
Thanks very much,
Andrea
On Wednesday, August 21, 2013 5:07:33 PM UTC+1, Vinny P wrote:
>
> On Wed, Aug 21, 2013 at 1:50 AM, Wei Liu <[email protected] <javascript:>
> > wrote:
>
>> UDP socket works in development server, but not deployed to app engine
>>
>> TCP socket works fine, but when I use UDP socket, it doesn't work.
>>
>>
> Just to clarify, are you saying that a TCP socket in a deployed App Engine
> application works for you, but an UDP socket doesn't work?
>
>
> On Wed, Aug 21, 2013 at 1:50 AM, Wei Liu <[email protected] <javascript:>
> > wrote:
>
>> After a long wait, my page comes with this:
>>
>> Error: Server Error The server encountered an error and could not
>> complete your request. If the problem persists, please
>> report<http://code.google.com/appengine/community.html> your
>> problem and mention this error message and the query that caused it.
>>
>
> Does anything show up in the logs? Go to your admin console and click the
> Logs link on the left hand side. Also, which server are you attempting to
> send messages to? It might be firewalled or blocking UDP in some way.
>
>
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.