Skip to content

[BUG] 400 Bad Request when exporting registrations #119

@yangchengs

Description

@yangchengs

This is a cx reporting issue and I can reproduce the same thing. The notification hub is standard tier.
When I run the sample code, it gives me error:
Error: HTTP/1.1 400 Bad Request - 400The supplied notificationhub job payload is invalid.TrackingId:85871df2-dd9d-48d5-b435-b7539879f3d1_G14,TimeStamp:2/1/2022 1:44:36 AM

pom.xml

com.windowsazure Notification-Hubs-java-sdk 0.4.2

code:

import com.windowsazure.messaging.NotificationHub;
import com.windowsazure.messaging.NotificationHubJob;
import com.windowsazure.messaging.NotificationHubJobStatus;
import com.windowsazure.messaging.NotificationHubJobType;

public class NotificationHubTest {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	// Submit an export job
	NotificationHub hub = new NotificationHub("Endpoint=sb://myhubspace2.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=xpPzFQR9etp9/UEUi6trxUpP6IEBAixV67AnqkoI5Tc=", "myhub002");
	
	try
	
	{
		NotificationHubJob job = new NotificationHubJob();
		job.setJobType(NotificationHubJobType.ExportRegistrations);
		job.setOutputContainerUri("https://yangshendls12312.blob.core.windows.net/dir1?sv=2018-03-28&sr=c&sig=1VI51zRmC71DHo2%2Ft1SfRcXUAYde%2BloFd8Xow15Ozy8%3D&se=2022-02-01T04%3A41%3A05Z&sp=rwl");
		job = hub.submitNotificationHubJob(job);

		// Wait until the job is done
		while(true){
		    Thread.sleep(1000);
		    job = hub.getNotificationHubJob(job.getJobId());
		    if(job.getJobStatus() == NotificationHubJobStatus.Completed)
		        break;
		}
	}
	catch (Exception ex)
	{
		System.out.print(ex.getMessage());			
	}
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions