Backend instances are not deployed

56 views
Skip to first unread message

Tolga Tanrıverdi

unread,
Aug 31, 2015, 7:06:57 PM8/31/15
to Google App Engine

I'm using google app engine for my IOS and Android application's server needs(Storing contents and datas for my applications) And I'm also using app engine to send push notifications to mobile clients. I'm using the below library to send push notifications:https://github.com/GoogleCloudPlatform/solutions-ios-push-notification-sample-backend-java

But when I integrate the above library to my code and deploy it to my google app engine account.GAE shows that there are backends in the code but it doesn't deploy it to any instances. GAE Frontend & Backend Instance Deployments

But after sometimes (after 2-3 hours) it automatically deploys the worker backend to 1 instance and then it starts to work and deliver notifications.But this is unaccaptable for me

So what I want is,my worker backend to start working immediately with the frontend instance and shutdown immediately with the frontend.(So it shouldn't work 7/24 ) Do you know why it may happen? Am I missing something.

You can find my app engine xml files below: AppEngine-Web XML:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>tokyo-analyst-845</application>
<version>1</version>

<threadsafe>true</threadsafe>

<sessions-enabled>true</sessions-enabled>

<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>

<use-google-connector-j>true</use-google-connector-j>

</appengine-web-app>

Backends.XML:

<backends>
  <backend name="worker">
  </backend>

Queue.XML:

<queue-entries>
  <queue>
    <name>notification-preprocessing</name>
    <rate>200/s</rate>
    <bucket-size>100</bucket-size>
  </queue>
  <queue>
    <name>notification-delivery</name>
    <mode>pull</mode>
  </queue>
  <queue>
    <name>notification-device-token-cleanup</name>
    <rate>10/s</rate>
    <bucket-size>20</bucket-size>
    <target>default</target>
  </queue>
</queue-entries>

Web.XML:

  <servlet-mapping>
     <servlet-name>spring</servlet-name>
     <url-pattern>/</url-pattern>
  </servlet-mapping>
  <context-param>
     <param-name>contextConfigLocation</param-name>
     <param-value>
        /WEB-INF/spring-servlet.xml
     </param-value>
  </context-param>
  <listener>
     <listener-class>
        org.springframework.web.context.ContextLoaderListener
     </listener-class>
  </listener>
<servlet>
  <servlet-name>PushNotificationWorkerServlet</servlet-name>
  <servlet-class>com.finarapp.pn.controller.PushNotificationWorkerServlet</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>PushNotificationWorkerServlet</servlet-name>
  <url-pattern>/_ah/start</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>PushPreProcessingServlet</servlet-name>
  <servlet-class>com.finarapp.pn.controller.PushPreProcessingServlet</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>PushPreProcessingServlet</servlet-name>
  <url-pattern>/admin/push/preprocessing</url-pattern>
</servlet-mapping>

Thanks

Patrice (Cloud Platform Support)

unread,
Sep 1, 2015, 12:16:57 PM9/1/15
to Google App Engine
Hi,

Looking into the java Backend documentation, this seems to be expected. If you don't specify your instance to be dynamic, it is "resident", which means it needs to be manually started.

You should not use backends anymore, but modules. I would suggest using a Manually scaled module. 

In any case, in your specific case, what is getting called to start your worker? Do you do the call yourself, is it part of your application?

Cheers

Tolga Tanrıverdi

unread,
Sep 1, 2015, 12:27:36 PM9/1/15
to Google App Engine
Hi Patrice

Thanks for the reply.
I've tried to specify my backend as dynamic and also resident. In both case the situation didn't change somehow app engine decide by itself for when to start my backends.

I'm starting my backends with connecting my backend servlet to  /_ah/start web service as much as I read from documentation it says /_ah/start starts when the instance is started.
And my backend servlet code is google's standard push notification code which you may find it in here:


Anyway I may change my backends to module but I don't know how. I'm using google eclipse plugin and I've created my project as google-> java web application
And as much as I can see java web application doesn't have support for ear(enterprise application) so is there any documentation to how to convert my java web application to enterprise application? And is it going to solve my problem ?

All I can see was the below documentation and it doesn't give the information that I need:

Thanks
Tolga

1 Eylül 2015 Salı 19:16:57 UTC+3 tarihinde Patrice (Cloud Platform Support) yazdı:

Patrice (Cloud Platform Support)

unread,
Sep 2, 2015, 4:36:36 PM9/2/15
to Google App Engine
Hey Tolga,

At this point, trying to change from backends to module would be more 1-1 help request than something suited for the google groups. I would suggest you go and ask this on Stack Overflow. Do note that we have some members of the support team on Stack Overflow answering questions, so you might end up getting help from the same people as you would get here (plus the added benefit of a bigger community of OTHER users to answer). Do take a second to read Stack's "how to ask" article and make sure you abide by this.

Now, for the backends not starting when you want them to, I'm actually not sure you should be using the /_ah/start to send to your backend, but you should make the call yourself. The call to /_ah/starts is what tells your instance to start. In your instance itself, you should send a request to something else, that should be handled by your backend. This also could be an interesting question for Stack Overflow, but as backends are getting deprecated, chances are you'll get a similar answer to mine (ie: "why not change to modules?").

Cheers
Reply all
Reply to author
Forward
0 new messages