【问题标题】:app-engine iOS push notification exception: "The specified queue is unknown"app-engine iOS 推送通知异常:“指定的队列未知”
【发布时间】:2014-11-08 18:06:22
【问题描述】:

我正在使用 Google 示例项目在我的应用引擎后端设置推送通知。以下方法抛出异常

private static void enqueuePushAlertToDevices(String alertMessage, String devicesAsJson) {
    Queue notificationQueue = QueueFactory.getQueue("notification-delivery");
    notificationQueue.add(TaskOptions.Builder.withMethod(TaskOptions.Method.PULL)
        .param("alert", alertMessage)
        .param("devices", devicesAsJson));
}

例外是

com.google.api.server.spi.SystemService invokeServiceMethod: The specified queue is unknown : notification-delivery
java.lang.IllegalStateException: The specified queue is unknown : notification-delivery
    at com.google.appengine.api.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:104)
    at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:552)
    at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:521)
    at com.google.appengine.api.utils.FutureWrapper.wrapAndCache(FutureWrapper.java:55)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:92)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
    at com.google.appengine.api.taskqueue.QueueApiHelper.getInternal(QueueApiHelper.java:72)
    at com.google.appengine.api.taskqueue.QueueImpl.add(QueueImpl.java:413)
....

鉴于该项目已经存在,我想许多开发人员一直在使用它。那么我应该在哪里定义队列"notification-delivery"?我理解这个问题:我正在使用一个尚未定义的队列。但我不清楚我应该在哪里定义它。我还没有在示例代码中找到答案。谢谢。

【问题讨论】:

    标签: java ios google-app-engine push-notification


    【解决方案1】:

    你看起来不够努力:)。其实并不明显。只需将示例中的queue.xml 复制到您的项目中即可。示例中的路径是

    /Downloads/solutions-ios-push-notification-sample-backend-java-master/war/WEB-INF
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-06
      • 2023-02-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多