Skip to content

Issue in registerPushNotification #146

@reshmabidikar

Description

@reshmabidikar

The registerPushNotificationCallback code does not work.

On invoking this code as follows:

const api: killbill.TenantApi = new killbill.TenantApi(config);
const cb = 'http://demo/callmeback';
api.registerPushNotificationCallback('created-by', cb, 'reason', 'comment')

The following error is shown in the Kill Bill logs:

2023-08-11T06:15:35,983+0000 lvl='WARN', log='WebComponent', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', A servlet request to the URI http://localhost:8080/1.0/kb/tenants/registerNotificationCallback?cb=http%3A%2F%2Fdemo%2Fcallmeback contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
2023-08-11T06:15:35,985+0000 lvl='INFO', log='LoggingFeature', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', 15 * Server has received a request on thread http-nio-8080-exec-6
15 > POST http://localhost:8080/1.0/kb/tenants/registerNotificationCallback?cb=http%3A%2F%2Fdemo%2Fcallmeback
15 > accept: application/json, text/plain, */*
15 > accept-encoding: gzip, compress, deflate, br
15 > authorization: **********
15 > connection: close
15 > content-length: 0
15 > content-type: application/x-www-form-urlencoded
15 > host: localhost:8080
15 > user-agent: axios/1.4.0
15 > x-killbill-apikey: bob
15 > x-killbill-apisecret: *****
15 > x-killbill-comment: comment
15 > x-killbill-createdby: created-by
15 > x-killbill-reason: reason

2023-08-11T06:15:35,986+0000 lvl='INFO', log='LoggingFeature', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', 15 * Server responded with a response on thread http-nio-8080-exec-6
15 < 415
15 < Content-Type: application/json

There is no record inserted in the tenant_kvs table corresponding to the push notification.

On investigating this further, I think this is due to the content-type: application/x-www-form-urlencoded header sent by the javascript client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions