Skip to content

Commit

Permalink
Merge pull request #70 from NashTech-Labs/feature/Added-shipment_test…
Browse files Browse the repository at this point in the history
…_cases

fixed code smell and updated readme file
  • Loading branch information
dev-swapnildixit4161 authored Jan 15, 2024
2 parents 15a65bc + cf90dba commit db0f184
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shipment-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This application is designed to manage the shipment process in a system using th
* Additionally, it uses the PubSubPublisherService to publish the shipment details to a Google Cloud Pub/Sub topic.

### Google Cloud Pub/Sub Integration:
* The PubSubPublisherService initializes the Pub/Sub publisher during application startup (@PostConstruct).
* The PubSubPublisherService initializes the Pub/Sub publisher during application startup.
* The publisher is responsible for converting shipment data into a Pub/Sub message and publishing it to the configured topic.
* During application shutdown (@PreDestroy), the publisher is gracefully shut down.
* During application shutdown the publisher is gracefully shut down.

### Data Storage:
* Shipment details, including user information, are persisted to a database for future reference.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
@Slf4j
public class PubSubPublisherService {
private Publisher publisher;
@SuppressWarnings("java:S6813")
@Autowired
private GCPConfig gcpConfig;
private ObjectMapper objectMapper;

public PubSubPublisherService(GCPConfig gcpConfig, Publisher publisher) {
this.gcpConfig = gcpConfig;
TopicName topicName = TopicName.of(gcpConfig.getProjectId(), gcpConfig.getTopicId());
objectMapper = new ObjectMapper();
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
this.publisher = publisher;
Expand Down

0 comments on commit db0f184

Please sign in to comment.