class MarriageCertService {

	public ReissueCertResponse createAsync(ReissueCertRequest reissueCertRequest) {

		List<MarriageDocument> marriageDocuments = reissueCertRequest.getReissueApplication().getDocuments();
		ReissueCertAppl reIssueApp = reissueCertRequest.getReissueApplication();
		List<ReissueCertAppl> reissueCertAppl = new ArrayList<ReissueCertAppl>();
		int docsSize = marriageDocuments.size();
		List<String> docIds = sequenceGenUtil.getIds(docsSize, "egmr_documents_id");
		reIssueApp.setId(sequenceGenUtil.getIds(1, reisuueIdSeq).get(0));

		int index = 0;
		for (MarriageDocument docs : marriageDocuments) {
			docs.setId(docIds.get(index++));
			docs.setReissueCertificateId(reIssueApp.getId());
		}

		try {
			kafkaTemplate.send(propertiesManager.getCreateReissueMarriageRegnTopicName(),
					propertiesManager.getCreateReissueMarriageRegnKey(), reissueCertRequest);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		reissueCertAppl.add(reIssueApp);
		return getMarriageCertResponse(reissueCertAppl, reissueCertRequest.getRequestInfo());
	}

}